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:
Michael Mann 2014-08-15 21:32:57 -04:00
parent f2a7a6d503
commit b95e6e3a61
1 changed files with 13 additions and 9 deletions

View File

@ -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