On Sun, Oct 18, 2009 at 6:04 AM, Laszlo Papp <[email protected]> wrote: > * Size examined str* function usage is a common coding practice, > because it's more safer to avoid breakage while using str* functions. > > Signed-off-by: Laszlo Papp <[email protected]> > --- > lib/libalpm/util.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c > index 553591d..41a5783 100644 > --- a/lib/libalpm/util.c > +++ b/lib/libalpm/util.c > @@ -105,7 +105,7 @@ int _alpm_makepath_mode(const char *path, mode_t mode) > /* we have another path component- append the newest > component to > * existing string and create one more level of dir > structure */ > strcat(incr, "/"); > - strcat(incr, ptr); > + strncat(incr, ptr, strlen(ptr)); > if(access(incr, F_OK)) { > if(mkdir(incr, mode)) { > ret = 1;
This is useless too. These two are equivalent, so we might as well go for the simpler one.
