summaryrefslogtreecommitdiffstats
path: root/runtime/vsprintf.c
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2009-01-23 14:28:47 +0100
committerMark Wielaard <mjw@redhat.com>2009-01-23 14:28:47 +0100
commitc3bad3042df505a3470f1e20b09822a9df1d4761 (patch)
tree6842e8eaa705e406379d34cf07a85431b6d71344 /runtime/vsprintf.c
parent750b1f2f5c84acaf0776de5239dc81e2e95c1dec (diff)
parentf120873cb40cfc16cc94f06fd722abc927b96227 (diff)
downloadsystemtap-steved-c3bad3042df505a3470f1e20b09822a9df1d4761.tar.gz
systemtap-steved-c3bad3042df505a3470f1e20b09822a9df1d4761.tar.xz
systemtap-steved-c3bad3042df505a3470f1e20b09822a9df1d4761.zip
Merge branch 'master' into pr6866.
Diffstat (limited to 'runtime/vsprintf.c')
-rw-r--r--runtime/vsprintf.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/runtime/vsprintf.c b/runtime/vsprintf.c
index 831b7a2b..2c3067cf 100644
--- a/runtime/vsprintf.c
+++ b/runtime/vsprintf.c
@@ -283,6 +283,7 @@ int _stp_vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
continue;
case 's':
+ case 'M':
case 'm':
s = va_arg(args, char *);
if ((unsigned long)s < PAGE_SIZE)
@@ -302,11 +303,20 @@ int _stp_vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
++str;
}
}
- for (i = 0; i < len; ++i) {
- if (str <= end)
- *str = *s;
- ++str; ++s;
+ if (*fmt == 'M') {
+ str = number(str, str + len - 1 < end ? str + len - 1 : end,
+ (unsigned long) *(uint64_t *) s,
+ 16, field_width, len, flags);
+ }
+ else {
+ for (i = 0; i < len; ++i) {
+ if (str <= end) {
+ *str = *s;
+ }
+ ++str; ++s;
+ }
}
+
while (len < field_width--) {
if (str <= end)
*str = ' ';
@@ -318,7 +328,6 @@ int _stp_vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
++str;
}
continue;
-
case 'X':
flags |= STP_LARGE;
case 'x':