version 1.1.1.1, 2012/02/21 23:48:05
|
version 1.1.1.3, 2013/07/22 01:32:11
|
Line 2
|
Line 2
|
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| PHP Version 5 | |
| PHP Version 5 | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| Copyright (c) 1997-2012 The PHP Group | | | Copyright (c) 1997-2013 The PHP Group | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| This source file is subject to version 3.01 of the PHP license, | |
| This source file is subject to version 3.01 of the PHP license, | |
| that is bundled with this package in the file LICENSE, and is | |
| that is bundled with this package in the file LICENSE, and is | |
Line 18
|
Line 18
|
|
|
/* $Id$ */ |
/* $Id$ */ |
|
|
| #define _GNU_SOURCE |
#include "php.h" |
#include "php.h" |
|
|
#include <zend_strtod.h> |
#include <zend_strtod.h> |
Line 94 static char * __cvt(double value, int ndigit, int *dec
|
Line 94 static char * __cvt(double value, int ndigit, int *dec
|
*decpt = 0; |
*decpt = 0; |
c = *p; |
c = *p; |
zend_freedtoa(p); |
zend_freedtoa(p); |
return(c == 'I' ? "INF" : "NAN"); | return strdup((c == 'I' ? "INF" : "NAN")); |
} |
} |
/* Make a local copy and adjust rve to be in terms of s */ |
/* Make a local copy and adjust rve to be in terms of s */ |
if (pad && fmode) { |
if (pad && fmode) { |
Line 782 static int format_converter(register buffy * odp, cons
|
Line 782 static int format_converter(register buffy * odp, cons
|
*/ |
*/ |
switch (*fmt) { |
switch (*fmt) { |
case 'Z': |
case 'Z': |
#if SUHOSIN_PATCH |
|
zend_suhosin_log(S_MISC, "'Z' specifier within format string"); |
|
goto skip_output; |
|
#else |
|
zvp = (zval*) va_arg(ap, zval*); |
zvp = (zval*) va_arg(ap, zval*); |
zend_make_printable_zval(zvp, &zcopy, &free_zcopy); |
zend_make_printable_zval(zvp, &zcopy, &free_zcopy); |
if (free_zcopy) { |
if (free_zcopy) { |
Line 796 static int format_converter(register buffy * odp, cons
|
Line 792 static int format_converter(register buffy * odp, cons
|
if (adjust_precision && precision < s_len) { |
if (adjust_precision && precision < s_len) { |
s_len = precision; |
s_len = precision; |
} |
} |
#endif |
|
break; |
break; |
case 'u': |
case 'u': |
switch(modifier) { |
switch(modifier) { |
Line 1098 static int format_converter(register buffy * odp, cons
|
Line 1093 static int format_converter(register buffy * odp, cons
|
|
|
|
|
case 'n': |
case 'n': |
#if SUHOSIN_PATCH |
|
zend_suhosin_log(S_MISC, "'n' specifier within format string"); |
|
#else |
|
*(va_arg(ap, int *)) = cc; |
*(va_arg(ap, int *)) = cc; |
#endif |
|
goto skip_output; |
goto skip_output; |
|
|
/* |
/* |
Line 1231 static void strx_printv(int *ccp, char *buf, size_t le
|
Line 1222 static void strx_printv(int *ccp, char *buf, size_t le
|
|
|
PHPAPI int ap_php_slprintf(char *buf, size_t len, const char *format,...) /* {{{ */ |
PHPAPI int ap_php_slprintf(char *buf, size_t len, const char *format,...) /* {{{ */ |
{ |
{ |
int cc; | unsigned int cc; |
va_list ap; |
va_list ap; |
|
|
va_start(ap, format); |
va_start(ap, format); |
Line 1247 PHPAPI int ap_php_slprintf(char *buf, size_t len, cons
|
Line 1238 PHPAPI int ap_php_slprintf(char *buf, size_t len, cons
|
|
|
PHPAPI int ap_php_vslprintf(char *buf, size_t len, const char *format, va_list ap) /* {{{ */ |
PHPAPI int ap_php_vslprintf(char *buf, size_t len, const char *format, va_list ap) /* {{{ */ |
{ |
{ |
int cc; | unsigned int cc; |
|
|
strx_printv(&cc, buf, len, format, ap); |
strx_printv(&cc, buf, len, format, ap); |
if (cc >= len) { |
if (cc >= len) { |