From: Dmitry Stogov Date: Thu, 14 May 2009 08:21:38 +0000 (+0000) Subject: Fixed wrong return value X-Git-Tag: php-5.2.10RC1~89 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b2ce675b6a6b88341377803ff11214ea4afa592d;p=php Fixed wrong return value --- diff --git a/main/php_sprintf.c b/main/php_sprintf.c index 6739c74c8c..b3f6b300e6 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; } /*