From f8740ea1ec93838d0218d6569b0af07cb784e64c Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Sat, 9 May 2015 13:56:00 +0200 Subject: [PATCH] Avoid a crash on Linux systems Use vsnprintf() (with n=0) instead of vsprintf() in dry-run mode. --- src/makefile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/makefile.c b/src/makefile.c index fd8235e..01e28a5 100644 --- a/src/makefile.c +++ b/src/makefile.c @@ -2650,7 +2650,7 @@ static int _makefile_print(FILE * fp, char const * format, ...) va_start(ap, format); if(fp == NULL) - ret = vsprintf(NULL, format, ap); + ret = vsnprintf(NULL, 0, format, ap); else ret = vfprintf(fp, format, ap); va_end(ap);