]> git.lizzy.rs Git - bspwm.git/commitdiff
Fix gcc warning regarding vsnprintf
authorBastien Dejean <nihilhill@gmail.com>
Wed, 11 Oct 2017 13:07:03 +0000 (15:07 +0200)
committerBastien Dejean <nihilhill@gmail.com>
Wed, 11 Oct 2017 13:07:03 +0000 (15:07 +0200)
src/helpers.c

index 85b175ef072d45593ac4be89c32ab91f33c5fd8b..1fc555f5a1850327bc2774b0eae2049dde6b70ad 100644 (file)
@@ -162,11 +162,9 @@ int asprintf(char **buf, const char *fmt, ...)
 
 int vasprintf(char **buf, const char *fmt, va_list args)
 {
-       int size = 0;
-
        va_list tmp;
        va_copy(tmp, args);
-       size = vsnprintf(NULL, size, fmt, tmp);
+       int size = vsnprintf(NULL, 0, fmt, tmp);
        va_end(tmp);
 
        if (size < 0) {