--- embedaddon/php/main/snprintf.c 2012/02/21 23:48:05 1.1.1.1 +++ embedaddon/php/main/snprintf.c 2013/07/22 01:32:11 1.1.1.3 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | 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, | | that is bundled with this package in the file LICENSE, and is | @@ -16,9 +16,9 @@ +----------------------------------------------------------------------+ */ -/* $Id: snprintf.c,v 1.1.1.1 2012/02/21 23:48:05 misho Exp $ */ +/* $Id: snprintf.c,v 1.1.1.3 2013/07/22 01:32:11 misho Exp $ */ - +#define _GNU_SOURCE #include "php.h" #include @@ -94,7 +94,7 @@ static char * __cvt(double value, int ndigit, int *dec *decpt = 0; c = *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 */ if (pad && fmode) { @@ -782,10 +782,6 @@ static int format_converter(register buffy * odp, cons */ switch (*fmt) { 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*); zend_make_printable_zval(zvp, &zcopy, &free_zcopy); if (free_zcopy) { @@ -796,7 +792,6 @@ static int format_converter(register buffy * odp, cons if (adjust_precision && precision < s_len) { s_len = precision; } -#endif break; case 'u': switch(modifier) { @@ -1098,11 +1093,7 @@ static int format_converter(register buffy * odp, cons case 'n': -#if SUHOSIN_PATCH - zend_suhosin_log(S_MISC, "'n' specifier within format string"); -#else *(va_arg(ap, int *)) = cc; -#endif goto skip_output; /* @@ -1231,7 +1222,7 @@ static void strx_printv(int *ccp, char *buf, size_t le PHPAPI int ap_php_slprintf(char *buf, size_t len, const char *format,...) /* {{{ */ { - int cc; + unsigned int cc; va_list ap; va_start(ap, format); @@ -1247,7 +1238,7 @@ 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) /* {{{ */ { - int cc; + unsigned int cc; strx_printv(&cc, buf, len, format, ap); if (cc >= len) {