summaryrefslogtreecommitdiffstats
path: root/runtime/vsprintf.c
diff options
context:
space:
mode:
authorhunt <hunt>2006-07-21 00:01:37 +0000
committerhunt <hunt>2006-07-21 00:01:37 +0000
commit428cd03159f5b1be72d06ea5eb110e9238dae4e3 (patch)
treefcf2818ce5eb48bca696eb882b82dfc3ece3dca0 /runtime/vsprintf.c
parent91ff416b8a764b61b4f4c290f74a90fe8326cb3b (diff)
downloadsystemtap-steved-428cd03159f5b1be72d06ea5eb110e9238dae4e3.tar.gz
systemtap-steved-428cd03159f5b1be72d06ea5eb110e9238dae4e3.tar.xz
systemtap-steved-428cd03159f5b1be72d06ea5eb110e9238dae4e3.zip
2006-07-20 Martin Hunt <hunt@redhat.com>
* vsprintf.c (_stp_vsnprintf): %p format fixes.
Diffstat (limited to 'runtime/vsprintf.c')
-rw-r--r--runtime/vsprintf.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/runtime/vsprintf.c b/runtime/vsprintf.c
index 7abb5dc5..4582ad83 100644
--- a/runtime/vsprintf.c
+++ b/runtime/vsprintf.c
@@ -296,12 +296,14 @@ int _stp_vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
case 'p':
len = 2*sizeof(void *) + 2;
- if (field_width == -1) {
+ flags |= STP_ZEROPAD;
+
+ if (field_width == -1)
field_width = len;
- flags |= STP_ZEROPAD;
- }
+
if (!(flags & STP_LEFT)) {
- while (len < field_width--) {
+ while (len < field_width) {
+ field_width--;
if (str <= end)
*str = ' ';
++str;
@@ -315,9 +317,10 @@ int _stp_vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
*str++ = 'x';
field_width--;
}
+
str = number(str, end,
(unsigned long) va_arg(args, int64_t),
- 16, field_width, precision, flags);
+ 16, field_width, field_width, flags);
continue;
case 'n':