From: Dmitry Stogov Date: Thu, 14 May 2009 08:22:09 +0000 (+0000) Subject: Fixed wrong return value X-Git-Tag: php-5.4.0alpha1~191^2~3668 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8217de479aa8d33d7c2a21fa8412a60fabdf352f;p=php Fixed wrong return value --- diff --git a/main/php_sprintf.c b/main/php_sprintf.c index 11cf1a871e..f3270a6cf0 100644 --- a/main/php_sprintf.c +++ b/main/php_sprintf.c @@ -37,9 +37,7 @@ php_sprintf (char*s, const char* format, ...) s[0] = '\0'; ret = vsprintf (s, format, args); va_end (args); - if (!ret) - return -1; - return strlen (s); + return (ret < 0) ? -1 : ret; } /*