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-double.c | |
parent | 1dccd1ee072722fbe6d5e1a9d726a7e87d191f76 (diff) | |
download | wireshark-4d3df66af44b563a1c6d6fe03fcdf09f93877dba.tar.gz |
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-double.c')
-rw-r--r-- | epan/ftypes/ftype-double.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/ftypes/ftype-double.c b/epan/ftypes/ftype-double.c index 5a0812f1cb..68a75314db 100644 --- a/epan/ftypes/ftype-double.c +++ b/epan/ftypes/ftype-double.c @@ -95,9 +95,9 @@ float_val_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_, int field_display _U_) } static void -float_val_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *buf) +float_val_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *buf, unsigned int size) { - g_snprintf(buf, DOUBLE_REPR_LENGTH, "%." G_STRINGIFY(FLT_DIG) "g", fv->value.floating); + g_snprintf(buf, size, "%." G_STRINGIFY(FLT_DIG) "g", fv->value.floating); } static int @@ -113,9 +113,9 @@ double_val_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_, int field_display _U_) } static void -double_val_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *buf) +double_val_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *buf, unsigned int size) { - g_snprintf(buf, DOUBLE_REPR_LENGTH, "%." G_STRINGIFY(DBL_DIG) "g", fv->value.floating); + g_snprintf(buf, size, "%." G_STRINGIFY(DBL_DIG) "g", fv->value.floating); } static gboolean |