From 1f6b4efc877b46a7ccb1514cacb3ffffb58e28a5 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 14 Oct 2015 21:56:57 +0200 Subject: argc can be 0, do not crash on error if it is MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mongoclock.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mongoclock.c b/src/mongoclock.c index 3170c95..96244b6 100644 --- a/src/mongoclock.c +++ b/src/mongoclock.c @@ -298,12 +298,11 @@ int main(int argc, char* argv[]) return 0; fail: - perror(*argv); + perror(argc ? *argv : "mongoclock"); fprintf(stdout, "\033[?25h\n\033[?1049l"); fflush(stdout); if (fd >= 0) close(fd); return 1; - (void) argc; } -- cgit v1.2.3-70-g09d2