Avoid a crash on Linux systems

Use vsnprintf() (with n=0) instead of vsprintf() in dry-run mode.
This commit is contained in:
Pierre Pronchery 2015-05-09 13:56:00 +02:00
parent 10dd6865a1
commit f8740ea1ec

View File

@ -2650,7 +2650,7 @@ static int _makefile_print(FILE * fp, char const * format, ...)
va_start(ap, format); va_start(ap, format);
if(fp == NULL) if(fp == NULL)
ret = vsprintf(NULL, format, ap); ret = vsnprintf(NULL, 0, format, ap);
else else
ret = vfprintf(fp, format, ap); ret = vfprintf(fp, format, ap);
va_end(ap); va_end(ap);