From: Thomas Hindoe Paaboel Andersen Date: Thu, 18 Sep 2014 23:43:04 +0000 (+0200) Subject: test: warn if we could not parse the loop count argument X-Git-Tag: v217~503 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=cbb452e7ef4419666af7ad343786ee54c23dd977;p=elogind.git test: warn if we could not parse the loop count argument Found by coverity. Fixes: CID#1237512 --- diff --git a/src/journal/test-journal-init.c b/src/journal/test-journal-init.c index ada2f6c3e..11fb150fe 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));