aboutsummaryrefslogtreecommitdiff
path: root/libbb/platform.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/platform.c')
-rw-r--r--libbb/platform.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libbb/platform.c b/libbb/platform.c
index d241d25a7..19734517b 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);