diff options
author | Jakob Kaivo <jkk@ung.org> | 2020-03-11 13:36:39 +0000 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2020-03-11 13:36:39 +0000 |
commit | 1bff06e0544732db44d6c093c74b48b9960f403d (patch) | |
tree | 5867ba3b5991d1e4eb82324b5db66bac03b9968f | |
parent | bd10656ef12c1c3fee804ddb51a0c69c3a03af48 (diff) |
adjust error check of initial call to vsnprintf() to account for the fact that we always add 1asprintf
-rw-r--r-- | asprintf.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -11,7 +11,7 @@ static inline int vasprintf(char **strp, const char *fmt, va_list ap) va_copy(cp, ap); int len = vsnprintf(NULL, 0, fmt, ap) + 1; - if (len < 0) { + if (len <= 0) { return -1; } |