dmitry          Thu May 14 08:21:38 2009 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/main       php_sprintf.c 
  Log:
  Fixed wrong return value
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/php_sprintf.c?r1=1.23.2.1.2.3&r2=1.23.2.1.2.4&diff_format=u
Index: php-src/main/php_sprintf.c
diff -u php-src/main/php_sprintf.c:1.23.2.1.2.3 
php-src/main/php_sprintf.c:1.23.2.1.2.4
--- php-src/main/php_sprintf.c:1.23.2.1.2.3     Wed Dec 31 11:17:47 2008
+++ php-src/main/php_sprintf.c  Thu May 14 08:21:38 2009
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_sprintf.c,v 1.23.2.1.2.3 2008/12/31 11:17:47 sebastian Exp $ */
+/* $Id: php_sprintf.c,v 1.23.2.1.2.4 2009/05/14 08:21:38 dmitry Exp $ */
 
 #include <stdio.h>
 #include <stdarg.h>
@@ -37,9 +37,7 @@
   s[0] = '\0';
   ret = vsprintf (s, format, args);
   va_end (args);
-  if (!ret)
-    return -1;
-  return strlen (s);
+  return (ret < 0) ? -1 : ret;
 }
 
 /*



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to