diff options
author | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2010-11-17 14:26:38 +0000 |
---|---|---|
committer | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2010-11-17 14:26:38 +0000 |
commit | 0d73807cbf659160c88a991a7d674397b5a990ee (patch) | |
tree | 83ca81624d607e023aac034dce3f8075f4ad7b57 /tap-iostat.c | |
parent | 263db68ab625c416e9cc4647c487d75b12a27c06 (diff) |
Allow <interval> to be successfully sscanf'd no matter the locale for the
decimal symbol. Fixes bug 2880.
svn path=/trunk/; revision=34926
Diffstat (limited to 'tap-iostat.c')
-rw-r--r-- | tap-iostat.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tap-iostat.c b/tap-iostat.c index c6838a4e57..e5b354d5b1 100644 --- a/tap-iostat.c +++ b/tap-iostat.c @@ -655,9 +655,12 @@ iostat_init(const char *optarg, void* userdata _U_) io_stat_t *io; const char *filter=NULL; - if(sscanf(optarg,"io,stat,%f,%n",&interval_float,&idx)==1){ + if(sscanf(optarg,"io,stat,%f%n",&interval_float,&idx)==1){ if(idx){ - filter=optarg+idx; + if(*(optarg+idx)==',') + filter=optarg+idx+1; + else + filter=optarg+idx; } else { filter=NULL; } |