tony2001 Tue Dec 19 12:44:26 2006 UTC
Modified files:
/php-src/ext/standard var.c
Log:
MFB: serialize() should use '.' as decimal point irrespectively to locale
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var.c?r1=1.252&r2=1.253&diff_format=u
Index: php-src/ext/standard/var.c
diff -u php-src/ext/standard/var.c:1.252 php-src/ext/standard/var.c:1.253
--- php-src/ext/standard/var.c:1.252 Thu Dec 14 23:41:57 2006
+++ php-src/ext/standard/var.c Tue Dec 19 12:44:26 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: var.c,v 1.252 2006/12/14 23:41:57 andrei Exp $ */
+/* $Id: var.c,v 1.253 2006/12/19 12:44:26 tony2001 Exp $ */
@@ -942,10 +942,12 @@
case IS_DOUBLE: {
char *s;
- ulong slen;
- slen = spprintf(&s, 0, "d:%.*G;", (int)
PG(serialize_precision), Z_DVAL_P(struc));
- smart_str_appendl(buf, s, slen);
+ smart_str_appendl(buf, "d:", 2);
+ s = (char *) emalloc(MAX_LENGTH_OF_DOUBLE +
PG(serialize_precision) + 1);
+ php_gcvt(Z_DVAL_P(struc),
PG(serialize_precision), '.', 'E', s);
+ smart_str_appends(buf, s);
+ smart_str_appendc(buf, ';');
efree(s);
return;
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php