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 fdd38825908ba49373f5c36c06d8e2d2d989f902..17ad3f75a65ccb51469b659bfc0dc5c2e003db2a 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);