From 1bd14839441d4c725479a674bf7a9e8ccaa521eb Mon Sep 17 00:00:00 2001 From: Giel van Schijndel Date: Sun, 11 Nov 2007 22:09:20 +0000 Subject: [PATCH] * Use snprintf (in vasprintf) to determine the size of the string we're about to construct git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2807 4a71c877-e1ca-e34f-864e-861f7616d084 --- lib/framework/printf_ext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/framework/printf_ext.c b/lib/framework/printf_ext.c index c662ae12c..fc12d8ace 100644 --- a/lib/framework/printf_ext.c +++ b/lib/framework/printf_ext.c @@ -28,7 +28,7 @@ int vasprintf(char** strp, const char* format, va_list ap) int count; // Find out how long the resulting string is - count = _vscprintf(format, ap); + count = snprintf(NULL, 0, format, ap); if (count == 0) {