Don't use g_strv_length on a single string, just use strlen. Also do the

null-check *before* calling strlen (if it's even necessary?)

Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9166

svn path=/trunk/; revision=52156
This commit is contained in:
Evan Huus 2013-09-20 14:41:22 +00:00
parent f3e76b0953
commit 4212b20048
1 changed files with 1 additions and 1 deletions

View File

@ -1101,7 +1101,7 @@ dissect_cablelabs_specific_opts(proto_tree *v_tree, proto_item *v_item, packet_i
device_type = tvb_get_ephemeral_string(tvb, sub_off, field_len);
if (g_strv_length(&device_type) == 0 || device_type == NULL) {
if (device_type == NULL || strlen(device_type) == 0) {
proto_item_append_text(ti, "Packet does not contain Device Type.");
} else {
proto_item_append_text(ti, "\"%s\"", device_type);