helly Fri Aug 8 15:47:30 2003 EDT
Modified files:
/php-src/main snprintf.c
Log:
Bugfix #24063 (marcus/ilia)
Index: php-src/main/snprintf.c
diff -u php-src/main/snprintf.c:1.25 php-src/main/snprintf.c:1.26
--- php-src/main/snprintf.c:1.25 Thu Jul 17 17:26:25 2003
+++ php-src/main/snprintf.c Fri Aug 8 15:47:30 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: snprintf.c,v 1.25 2003/07/17 21:26:25 helly Exp $ */
+/* $Id: snprintf.c,v 1.26 2003/08/08 19:47:30 helly Exp $ */
/* ====================================================================
* Copyright (c) 1995-1998 The Apache Group. All rights reserved.
@@ -344,9 +344,17 @@
buf[0] = '\0';
return (buf);
}
- while (p <= p1 && p < &buf[NDIG]) {
+ if (p <= p1 && p < &buf[NDIG]) {
arg = modf(arg * 10, &fj);
- *p++ = (int) fj + '0';
+ if ((int)fj==10) {
+ *p++ = '1';
+ fj = 0;
+ *decpt = ++r2;
+ }
+ while (p <= p1 && p < &buf[NDIG]) {
+ *p++ = (int) fj + '0';
+ arg = modf(arg * 10, &fj);
+ }
}
if (p1 >= &buf[NDIG]) {
buf[NDIG - 1] = '\0';
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php