[PATCH] fix for inconsistent output of spprintf() (for %p specifier)

php.internals

Eric Lambart

22 years ago
Hello folks, In all functions using spprintf(), the output corresponding to the format conversion specifier "%p" depends on the value of the *previously* converted argument (if any), not just the pointer corresponding to the specifier. 1) If the previously-converted argument was a non-zero integer, the hexadecimal string value will be correctly prefixed with "0x". 2) If there was no previously-converted argument, or if it was zero or a non-integer, the "0x" hexadecimal prefix will be missing. The attached patch fixes this problem, as also reported in bug #28012 http://bugs.php.net/bug.php?id=28012 It's clearly the most minor of minor bugs but the output of %p has puzzled me for a while and I decided today to track it down. Hope this helps! Thanks, Eric Lambart

Marcus Börger

22 years ago
Hello Eric, thanks for noticing. marcus Thursday, April 15, 2004, 11:30:07 PM, you wrote:
> Hello folks, > In all functions using spprintf(), the output corresponding to the > format conversion specifier "%p" depends on the value of the > *previously* converted argument (if any), not just the pointer > corresponding to the specifier.
[...]