io_graph_item: fix false positive array subscript is above array bounds [-Werror=array-bounds]

Change-Id: I14fc19f131782a9c85104ca2189b9452079d0013
Reviewed-on: https://code.wireshark.org/review/20454
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Alexis La Goutte 2017-03-08 23:05:14 +01:00 committed by Michael Mann
parent 3a63f8dc61
commit 9e0251f218
1 changed files with 1 additions and 0 deletions

View File

@ -116,6 +116,7 @@ GString *check_field_unit(const char *field_name, int *hf_index, io_graph_item_u
case IOG_ITEM_UNIT_CALC_LOAD:
break;
default:
g_assert(item_unit < NUM_IOG_ITEM_UNITS);
err_str = g_string_new("");
g_string_printf(err_str, "\"%s\" is a relative-time field. %s calculations are not supported on it.",
field_name,