libbb: fix vasprintf implementation
authorDenys Vlasenko <vda.linux@googlemail.com>
Tue, 17 Nov 2009 04:33:47 +0000 (05:33 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 17 Nov 2009 04:33:47 +0000 (05:33 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb/platform.c

index fdd3882..17ad3f7 100644 (file)
@@ -30,7 +30,8 @@ int FAST_FUNC vasprintf(char **string_ptr, const char *format, va_list p)
 
        if (r < 128) {
                va_end(p2);
-               return xstrdup(buf);
+               *string_ptr = xstrdup(buf);
+               return r;
        }
 
        *string_ptr = xmalloc(r+1);