forked from osmocom/wireshark
Escape double quotes when printing ABSOLUTE_TIME field
This regression was introduced by the commit e5353bf119
done for bug 10081
Bug: 10213
Change-Id: I3925a47ef13055f10f49fa9fefd022731746fbb8
Reviewed-on: https://code.wireshark.org/review/2572
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
parent
f2a7a6d503
commit
b95e6e3a61
|
@ -324,28 +324,32 @@ value_get(fvalue_t *fv)
|
|||
}
|
||||
|
||||
static int
|
||||
absolute_val_repr_len(fvalue_t *fv, ftrepr_t rtype _U_)
|
||||
absolute_val_repr_len(fvalue_t *fv, ftrepr_t rtype)
|
||||
{
|
||||
gchar *rep;
|
||||
int ret;
|
||||
int ret;
|
||||
|
||||
rep = abs_time_to_str(NULL, &fv->value.time, ABSOLUTE_TIME_LOCAL,
|
||||
rtype == FTREPR_DISPLAY);
|
||||
rtype == FTREPR_DISPLAY);
|
||||
|
||||
ret = (int)strlen(rep) + 2; /* 2 for opening and closing quotes */
|
||||
ret = (int)strlen(rep) + ((rtype == FTREPR_DFILTER) ? 2 : 0); /* 2 for opening and closing quotes */
|
||||
|
||||
wmem_free(NULL, rep);
|
||||
wmem_free(NULL, rep);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
absolute_val_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf)
|
||||
absolute_val_to_repr(fvalue_t *fv, ftrepr_t rtype, char *buf)
|
||||
{
|
||||
gchar *rep = abs_time_to_str(NULL, &fv->value.time, ABSOLUTE_TIME_LOCAL,
|
||||
rtype == FTREPR_DISPLAY);
|
||||
sprintf(buf, "\"%s\"", rep);
|
||||
wmem_free(NULL, rep);
|
||||
rtype == FTREPR_DISPLAY);
|
||||
if (rtype == FTREPR_DFILTER) {
|
||||
sprintf(buf, "\"%s\"", rep);
|
||||
} else {
|
||||
strcpy(buf, rep);
|
||||
}
|
||||
wmem_free(NULL, rep);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
Loading…
Reference in New Issue