Allow <interval> to be successfully sscanf'd no matter the locale for the

decimal symbol.  Similar to the fix made to tap-iostat.c to resolve bug 2880.

Motivated by the discussion started from this thread on the user list:
http://www.wireshark.org/lists/wireshark-users/201103/msg00018.html

svn path=/trunk/; revision=36160
This commit is contained in:
Chris Maynard 2011-03-07 21:58:30 +00:00
parent e6ce1793e2
commit 4f8edc81e6
1 changed files with 5 additions and 2 deletions

View File

@ -515,9 +515,12 @@ comparestat_init(const char *optarg, void* userdata _U_)
gint start, stop,ttl, order, pos=0;
gdouble variance;
if(sscanf(optarg,"compare,%d,%d,%d,%d,%lf,%n",&start, &stop, &ttl, &order, &variance, &pos)==5){
if(sscanf(optarg,"compare,%d,%d,%d,%d,%lf%n",&start, &stop, &ttl, &order, &variance, &pos)==5){
if(pos){
filter=optarg+pos;
if(*(optarg+pos)==',')
filter=optarg+pos+1;
else
filter=optarg+pos;
} else {
filter=NULL;
}