From a52793aec18385ce46fbeb9952919c86a4b17085 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 1 Aug 2016 17:35:19 -0700 Subject: [PATCH] Remove trailing "." from OID strings. The previous change removed code that did that. Change-Id: If297018f5902af7a2d9cacb0cc9a5f1ffe1e1d00 Reviewed-on: https://code.wireshark.org/review/16834 Reviewed-by: Guy Harris --- epan/oids.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/epan/oids.c b/epan/oids.c index 66a9c12a45..37f0770ce6 100644 --- a/epan/oids.c +++ b/epan/oids.c @@ -862,6 +862,7 @@ char* oid_subid2string(wmem_allocator_t *scope, guint32* subids, guint len) { char* rel_oid_subid2string(wmem_allocator_t *scope, guint32* subids, guint len, gboolean is_absolute) { wmem_strbuf_t *oid_str; + gsize oid_str_len; if(!subids || len == 0) return wmem_strdup(scope, "*** Empty OID ***"); @@ -875,6 +876,10 @@ char* rel_oid_subid2string(wmem_allocator_t *scope, guint32* subids, guint len, wmem_strbuf_append_printf(oid_str, "%u.",*subids++); } while(--len); + /* Remove trailing "." (which is guaranteed to be there) */ + oid_str_len = wmem_strbuf_get_len(oid_str); + wmem_strbuf_truncate(oid_str, oid_str_len - 1); + return wmem_strbuf_finalize(oid_str); }