CID 22597: va_start/va_end mismatch

This commit is contained in:
Enno Rehling 2015-10-29 20:43:37 +01:00
parent 77ad91f8a4
commit d3f7bd7b10

View file

@ -119,12 +119,11 @@ size_t slprintf(char * dst, size_t size, const char * format, ...)
va_start(args, format); va_start(args, format);
result = vsnprintf(dst, size, format, args); result = vsnprintf(dst, size, format, args);
va_end(args);
if (result < 0 || result >= (int)size) { if (result < 0 || result >= (int)size) {
dst[size - 1] = '\0'; dst[size - 1] = '\0';
return size; return size;
} }
va_start(args, format);
va_end(args);
return (size_t)result; return (size_t)result;
} }