summaryrefslogtreecommitdiffstats
path: root/programs/fuzzer.c
diff options
context:
space:
mode:
Diffstat (limited to 'programs/fuzzer.c')
-rw-r--r--programs/fuzzer.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/programs/fuzzer.c b/programs/fuzzer.c
index aa91ee8..1704b6e 100644
--- a/programs/fuzzer.c
+++ b/programs/fuzzer.c
@@ -1017,7 +1017,7 @@ static int FUZ_usage(char* programName)
DISPLAY( "\n");
DISPLAY( "Arguments :\n");
DISPLAY( " -i# : Nb of tests (default:%i) \n", NB_ATTEMPTS);
- DISPLAY( " -T# : Duration of tests (default: use Nb of tests) \n");
+ DISPLAY( " -T# : Duration of tests, in seconds (default: use Nb of tests) \n");
DISPLAY( " -s# : Select seed (default:prompt user)\n");
DISPLAY( " -t# : Select starting test number (default:0)\n");
DISPLAY( " -P# : Select compressibility in %% (default:%i%%)\n", FUZ_COMPRESSIBILITY_DEFAULT);
@@ -1084,26 +1084,23 @@ int main(int argc, char** argv)
case 'T':
argument++;
nbTests = 0; duration = 0;
-
for (;;)
{
- if (argument[0]=='m')
- {
- duration *= 60;
- argument++;
- continue;
- }
- if (argument[0]=='n')
- {
- argument++;
- continue;
- }
- if ((*argument>='0') && (*argument<='9'))
+ switch(*argument)
{
- duration *= 10;
- duration += *argument - '0';
- argument++;
- continue;
+ case 'm': duration *= 60; argument++; continue;
+ case 's':
+ case 'n': argument++; continue;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': duration *= 10; duration += *argument++ - '0'; continue;
}
break;
}