diff options
author | hunt <hunt> | 2007-10-10 14:12:13 +0000 |
---|---|---|
committer | hunt <hunt> | 2007-10-10 14:12:13 +0000 |
commit | d319669c3f77a3e451f1cad845471433e6d0dbfa (patch) | |
tree | 24cbeb006365fdaa21dbf9cf3b44eae055684123 /tapset/aux_syscalls.stp | |
parent | 8e67a997469cfdc08db58a214612f63dd6e8ebab (diff) | |
download | systemtap-steved-d319669c3f77a3e451f1cad845471433e6d0dbfa.tar.gz systemtap-steved-d319669c3f77a3e451f1cad845471433e6d0dbfa.tar.xz systemtap-steved-d319669c3f77a3e451f1cad845471433e6d0dbfa.zip |
2007-10-10 Martin Hunt <hunt@redhat.com>
* aux_syscalls.stp (_stp_lookup_str): When defaulting
to a numeric value, append, don't overwrite.
Diffstat (limited to 'tapset/aux_syscalls.stp')
-rw-r--r-- | tapset/aux_syscalls.stp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tapset/aux_syscalls.stp b/tapset/aux_syscalls.stp index 08018ad2..05c7dc98 100644 --- a/tapset/aux_syscalls.stp +++ b/tapset/aux_syscalls.stp @@ -1520,7 +1520,7 @@ typedef struct { void _stp_lookup_str(const _stp_val_array * const array, long val, char *ptr, int len) { - int i = 0; + int i = 0, slen; while (array[i].name) { if (array[i].val == val) { strlcat (ptr, array[i].name, len); @@ -1528,15 +1528,18 @@ void _stp_lookup_str(const _stp_val_array * const array, long val, char *ptr, in } i++; } - snprintf(ptr, len, "0x%lx", val); + slen = strlen(ptr); + _stp_snprintf(ptr + slen, len - slen, "0x%lx", val); } void _stp_lookup_or_str(const _stp_val_array * const array, long val, char *ptr, int len) { int i = 0, flag = 0; + if (val == 0) { _stp_lookup_str(array, val, ptr, len); return; } + while (array[i].name) { if (array[i].val & val) { if (flag) |