diff options
author | Michael Mann <mmann78@netscape.net> | 2016-05-10 16:37:44 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-05-10 22:49:25 +0000 |
commit | 4d3df66af44b563a1c6d6fe03fcdf09f93877dba (patch) | |
tree | a9d9927c9c20bfdc0b304f439a024b34fd55eac3 /epan/ftypes/ftype-guid.c | |
parent | 1dccd1ee072722fbe6d5e1a9d726a7e87d191f76 (diff) |
Give FvalueToStringRepr a length parameter.
This allows the conversion of a few straggler strcpy calls
in ftype library. Also provides a more accurate size value
instead of the many hard coded values the ftypes were using.
Change-Id: Ia6273980432e16ad3a6233816a6054d9fed5d2a4
Reviewed-on: https://code.wireshark.org/review/15344
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/ftypes/ftype-guid.c')
-rw-r--r-- | epan/ftypes/ftype-guid.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/epan/ftypes/ftype-guid.c b/epan/ftypes/ftype-guid.c index f5731032ee..ac5d521d2a 100644 --- a/epan/ftypes/ftype-guid.c +++ b/epan/ftypes/ftype-guid.c @@ -61,15 +61,15 @@ get_guid(const char *s, e_guid_t *guid) } p = s; - strncpy(digits, p, 8); + g_strlcpy(digits, p, 8); digits[8] = '\0'; guid->data1 = (guint32)strtoul(digits, NULL, 16); p += 9; - strncpy(digits, p, 4); + g_strlcpy(digits, p, 4); digits[4] = '\0'; guid->data2 = (guint16)strtoul(digits, NULL, 16); p += 5; - strncpy(digits, p, 4); + g_strlcpy(digits, p, 4); digits[4] = '\0'; guid->data3 = (guint16)strtoul(digits, NULL, 16); p += 5; @@ -105,9 +105,9 @@ guid_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_, int field_display _U_) } static void -guid_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *buf) +guid_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *buf, unsigned int size) { - guid_to_str_buf(&fv->value.guid, buf, GUID_STR_LEN); + guid_to_str_buf(&fv->value.guid, buf, size); } static gboolean |