cvs: php-src(PHP_5_2) /ext/standard var.c

From: Date: Tue, 19 Dec 2006 12:36:44 +0000
Subject: cvs: php-src(PHP_5_2) /ext/standard var.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-42172@lists.php.net to get a copy of this message
tony2001 Tue Dec 19 12:36:44 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/standard var.c Log: serialize() should use '.' as decimal point irrespectively to locale http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var.c?r1=1.203.2.7.2.10&r2=1.203.2.7.2.11&diff_format=u Index: php-src/ext/standard/var.c diff -u php-src/ext/standard/var.c:1.203.2.7.2.10 php-src/ext/standard/var.c:1.203.2.7.2.11 --- php-src/ext/standard/var.c:1.203.2.7.2.10 Fri Dec 8 21:18:43 2006 +++ php-src/ext/standard/var.c Tue Dec 19 12:36:44 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: var.c,v 1.203.2.7.2.10 2006/12/08 21:18:43 tony2001 Exp $ */ +/* $Id: var.c,v 1.203.2.7.2.11 2006/12/19 12:36:44 tony2001 Exp $ */ @@ -689,10 +689,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; }

« previous php.cvs (#42172) next »