diff options
author | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2012-12-09 04:49:58 +0000 |
---|---|---|
committer | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2012-12-09 04:49:58 +0000 |
commit | 394853ec7ea8d03fc6670e54bb69d0c3564a766f (patch) | |
tree | 468d0989146d20d15546c258fcc82382581b632c /epan/dissectors/packet-per.c | |
parent | e5e25f867064eae126ff6580866893a308d338b6 (diff) |
Similarly avoiding calling g_snprintf() in dissect_per_constrained_integer().
svn path=/trunk/; revision=46479
Diffstat (limited to 'epan/dissectors/packet-per.c')
-rw-r--r-- | epan/dissectors/packet-per.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/epan/dissectors/packet-per.c b/epan/dissectors/packet-per.c index e579edf86d..21c87cca1a 100644 --- a/epan/dissectors/packet-per.c +++ b/epan/dissectors/packet-per.c @@ -1209,7 +1209,13 @@ DEBUG_ENTRY("dissect_per_constrained_integer"); /* prepare the string (max number of bits + quartet separators + field name + ": ") */ str_length = 256+64+(int)strlen(hfi->name)+2; str=ep_alloc(str_length+1); - str_index = g_snprintf(str, str_length+1, "%s: ", hfi->name); + + /* Avoiding g_snprintf() here */ + g_strlcpy(str, hfi->name, str_length); + str_index = strlen(hfi->name); + str[str_index++] = ':'; + str[str_index++] = ' '; + for(bit=0;bit<((int)(offset&0x07));bit++){ if(bit&&(!(bit%4))){ if (str_index < str_length) str[str_index++] = ' '; |