cvs: php4 /ext/standard php_smart_str.h

From: Date: Fri, 03 Aug 2001 11:09:13 +0000
Subject: cvs: php4 /ext/standard php_smart_str.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-6510@lists.php.net to get a copy of this message
sas Fri Aug 3 07:09:13 2001 EDT Modified files: /php4/ext/standard php_smart_str.h Log: Treat trailing zeroes correctly Index: php4/ext/standard/php_smart_str.h diff -u php4/ext/standard/php_smart_str.h:1.9 php4/ext/standard/php_smart_str.h:1.10 --- php4/ext/standard/php_smart_str.h:1.9 Fri Aug 3 03:25:27 2001 +++ php4/ext/standard/php_smart_str.h Fri Aug 3 07:09:13 2001 @@ -80,6 +80,7 @@ { char *p = buf; long tmp = 0; + int n = 0; if (num < 0) { num = -num; @@ -89,12 +90,13 @@ while (num > 0) { tmp = tmp * 10 + (num % 10); num /= 10; + n++; } do { *p++ = (tmp % 10) + '0'; tmp /= 10; - } while (tmp > 0); + } while (--n > 0); return p; }

« previous php.cvs (#6510) next »