diff options
author | George Peter Banyard <girgias@php.net> | 2020-01-23 12:57:48 +0100 |
---|---|---|
committer | George Peter Banyard <girgias@php.net> | 2020-01-23 13:45:28 +0100 |
commit | 2b5fb76de6dd164064888ac5e95cc7d68ad38990 (patch) | |
tree | 13caeade366125beccba5610bbe10b64c950fe08 | |
parent | 28e650abf8097a28789a005e5028fee095359583 (diff) | |
download | php-git-2b5fb76de6dd164064888ac5e95cc7d68ad38990.tar.gz |
Apply custom format/length modifier removal to spprintf
This mimicks the changes made to the custom snprintf implementation
by removing the custom 'v' format and custom 'I' length modifier
from the spprintf implementation.
Closes GH-5108
-rw-r--r-- | UPGRADING.INTERNALS | 6 | ||||
-rw-r--r-- | main/spprintf.c | 20 |
2 files changed, 3 insertions, 23 deletions
diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 1714e26eb0..8e7cb66826 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -82,12 +82,12 @@ PHP 8.0 INTERNALS UPGRADE NOTES compare handler, using ZEND_COMPARE_OBJECTS_FALLBACK() macro. k. The 'I' length modifier, used to denote 32 and 64bit integer from the custom - snprintf implementation has been removed. + snprintf and spprintf implementations has been removed. Use the ZEND_LONG_FMT, ZEND_ULONG_FMT and ZEND_XLONG_FMT macros defined in php-src/Zend/zend_long.h - The 'v' format from the custom snprintf implementation has been removed. - Use the standard 's' format instead. + The 'v' format from the custom snprintf and spprintf implementations has + been removed. Use the standard 's' format instead. ======================== 2. Build system changes diff --git a/main/spprintf.c b/main/spprintf.c index 5b1bafccff..cae2e12c5e 100644 --- a/main/spprintf.c +++ b/main/spprintf.c @@ -312,25 +312,6 @@ static void xbuf_format_converter(void *xbuf, zend_bool is_char, const char *fmt fmt++; modifier = LM_LONG_DOUBLE; break; - case 'I': - fmt++; -#if SIZEOF_LONG_LONG - if (*fmt == '6' && *(fmt+1) == '4') { - fmt += 2; - modifier = LM_LONG_LONG; - } else -#endif - if (*fmt == '3' && *(fmt+1) == '2') { - fmt += 2; - modifier = LM_LONG; - } else { -#ifdef _WIN64 - modifier = LM_LONG_LONG; -#else - modifier = LM_LONG; -#endif - } - break; case 'l': fmt++; #if SIZEOF_LONG_LONG @@ -587,7 +568,6 @@ static void xbuf_format_converter(void *xbuf, zend_bool is_char, const char *fmt case 's': - case 'v': s = va_arg(ap, char *); if (s != NULL) { if (!adjust_precision) { |