aboutsummaryrefslogtreecommitdiffstats
path: root/epan/oids.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-08-01 17:35:19 -0700
committerGuy Harris <guy@alum.mit.edu>2016-08-02 00:36:06 +0000
commita52793aec18385ce46fbeb9952919c86a4b17085 (patch)
treedc5a62cca4f53b91bcbe45ed83e89008b7ccc808 /epan/oids.c
parenta98b55f4f842d580c38bde35d37d907d0d115ccd (diff)
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 <guy@alum.mit.edu>
Diffstat (limited to 'epan/oids.c')
-rw-r--r--epan/oids.c5
1 files changed, 5 insertions, 0 deletions
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);
}