From: Wayne Davison Date: Sat, 8 Oct 2011 16:16:43 +0000 (-0700) Subject: Test asprintf() failure with < 0, not <= 0. X-Git-Tag: v3.1.0pre1~67 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7c8f180900432e646c0a4bd02e2c4033068dbb7c;p=thirdparty%2Frsync.git Test asprintf() failure with < 0, not <= 0. --- diff --git a/util.c b/util.c index 4ffd462d..ea9ca7d8 100644 --- a/util.c +++ b/util.c @@ -762,7 +762,7 @@ void glob_expand_module(char *base1, char *arg, char ***argv_p, int *argc_p, int if (!(arg = strdup(arg))) out_of_memory("glob_expand_module"); - if (asprintf(&base," %s/", base1) <= 0) + if (asprintf(&base," %s/", base1) < 0) out_of_memory("glob_expand_module"); base_len++; @@ -1144,7 +1144,7 @@ char *full_fname(const char *fn) } else m1 = m2 = m3 = ""; - if (asprintf(&result, "\"%s%s%s\"%s%s%s", p1, p2, fn, m1, m2, m3) <= 0) + if (asprintf(&result, "\"%s%s%s\"%s%s%s", p1, p2, fn, m1, m2, m3) < 0) out_of_memory("full_fname"); return result;