diff options
author | Thomas Hindoe Paaboel Andersen <phomes@gmail.com> | 2014-09-19 01:43:04 +0200 |
---|---|---|
committer | Thomas Hindoe Paaboel Andersen <phomes@gmail.com> | 2014-09-19 01:45:59 +0200 |
commit | cbb452e7ef4419666af7ad343786ee54c23dd977 (patch) | |
tree | e0b3f03027142eaa71b545fa5b1fd1ea4ce72c21 /src | |
parent | 8e8af4cfc7fa373504a22e58966909161acfb72f (diff) |
test: warn if we could not parse the loop count argument
Found by coverity. Fixes: CID#1237512
Diffstat (limited to 'src')
-rw-r--r-- | src/journal/test-journal-init.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/journal/test-journal-init.c b/src/journal/test-journal-init.c index ada2f6c3e4..11fb150fe8 100644 --- a/src/journal/test-journal-init.c +++ b/src/journal/test-journal-init.c @@ -31,8 +31,12 @@ int main(int argc, char *argv[]) { log_set_max_level(LOG_DEBUG); - if (argc >= 2) - safe_atoi(argv[1], &I); + if (argc >= 2) { + r = safe_atoi(argv[1], &I); + if (r < 0) + log_info("Could not parse loop count argument. Using default."); + } + log_info("Running %d loops", I); assert_se(mkdtemp(t)); |