[PATCH] fix for inconsistent output of spprintf() (for %p specifier)
| From: | Eric Lambart | Date: | Thu, 15 Apr 2004 21:30:07 +0000 |
| Subject: | [PATCH] fix for inconsistent output of spprintf() (for %p specifier) | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-9236@lists.php.net to get a copy of this message | ||
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
Attachment: [text/x-patch] spprintf.c.patch
Attachment: [text/x-patch] spprintf.c.patch