aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2005-06-22 15:37:46 +0000
committerGerald Combs <gerald@wireshark.org>2005-06-22 15:37:46 +0000
commit6a4b3f9cd7f8a3cf2788218c8744c0d83a6614cc (patch)
treedb9bd2e5f6eb000da06e75657e825ac1abe4e130
parent299ce87bfe22bbdfecd5b8bbeb5e513da31ff380 (diff)
Fix an off-by-four error, which should take care of bugs 254 - 258. Print
OID values as unsigned ints instead of signed. svn path=/trunk/; revision=14729
-rw-r--r--epan/to_str.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/to_str.c b/epan/to_str.c
index 6641ea61cf..b820ab2e74 100644
--- a/epan/to_str.c
+++ b/epan/to_str.c
@@ -915,19 +915,19 @@ gchar* oid_to_str_buf(const guint8 *oid, gint oid_len, gchar *buf) {
bufp = buf; value=0;
for (i=0; i<oid_len; i++){
byte = oid[i];
- if ((bufp - buf) > (MAX_OID_STR_LEN - 12)) {
+ if ((bufp - buf) > (MAX_OID_STR_LEN - 16)) { /* "4294967295" + ".>>>" + '\0' + 1 */
bufp += sprintf(bufp, ".>>>");
break;
}
if (i == 0) {
- bufp += sprintf(bufp, "%d.%d", byte/40, byte%40);
+ bufp += sprintf(bufp, "%u.%u", byte/40, byte%40);
continue;
}
value = (value << 7) | (byte & 0x7F);
if (byte & 0x80) {
continue;
}
- bufp += sprintf(bufp, ".%d", value);
+ bufp += sprintf(bufp, ".%u", value);
value = 0;
}
*bufp = '\0';