diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-10-14 21:56:57 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-10-14 21:56:57 +0200 |
commit | 1f6b4efc877b46a7ccb1514cacb3ffffb58e28a5 (patch) | |
tree | ef0ac34e5d335fb83e13e4466593037bd0280e1f /src/mongoclock.c | |
parent | linux guarantees that a call to clock will always close the file descriptor if valid (diff) | |
download | mongotimer-1f6b4efc877b46a7ccb1514cacb3ffffb58e28a5.tar.gz mongotimer-1f6b4efc877b46a7ccb1514cacb3ffffb58e28a5.tar.bz2 mongotimer-1f6b4efc877b46a7ccb1514cacb3ffffb58e28a5.tar.xz |
argc can be 0, do not crash on error if it is
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/mongoclock.c')
-rw-r--r-- | src/mongoclock.c | 3 |
1 files changed, 1 insertions, 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; } |