Test asprintf() failure with < 0, not <= 0.
authorWayne Davison <wayned@samba.org>
Sat, 8 Oct 2011 16:16:43 +0000 (09:16 -0700)
committerWayne Davison <wayned@samba.org>
Sat, 8 Oct 2011 16:16:43 +0000 (09:16 -0700)
util.c

diff --git a/util.c b/util.c
index 4ffd462d4a31284ab9a61df942b37ea43eed70c4..ea9ca7d8e3395c107e583a1a399219da7af25032 100644 (file)
--- 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;