Fix -z statistics command line parsing

The string comparison must be done against the length of the registered command, not against the length or the string given as an argument.
Otherwise optional parameters are taken into account.

Change-Id: Iec4032fc10b00e606770533c5a567d7b49663593
Reviewed-on: https://code.wireshark.org/review/6075
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
This commit is contained in:
Pascal Quantin 2014-12-27 15:42:53 +01:00
parent 0ea310dd2f
commit 1ae0c4a643
1 changed files with 1 additions and 1 deletions

View File

@ -85,7 +85,7 @@ process_stat_cmd_arg(char *optstr)
for(entry=stat_cmd_arg_list;entry;entry=g_slist_next(entry)){
sca=(stat_cmd_arg *)entry->data;
if(!strncmp(sca->cmd,optstr,strlen(optstr))){
if(!strncmp(sca->cmd,optstr,strlen(sca->cmd))){
tr=(stat_requested *)g_malloc(sizeof (stat_requested));
tr->sca = sca;
tr->arg=g_strdup(optstr);