summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbb/platform.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libbb/platform.c b/libbb/platform.c
index d241d25..1973451 100644
--- a/libbb/platform.c
+++ b/libbb/platform.c
@@ -33,7 +33,7 @@ int FAST_FUNC vasprintf(char **string_ptr, const char *format, va_list p)
if (r < 128) {
va_end(p2);
*string_ptr = strdup(buf);
- return r;
+ return (*string_ptr ? r : -1);
}
*string_ptr = malloc(r+1);