diff options
-rw-r--r-- | src/satq.c | 7 | ||||
-rw-r--r-- | src/satr.c | 7 | ||||
-rw-r--r-- | src/satrm.c | 6 |
3 files changed, 6 insertions, 14 deletions
@@ -59,11 +59,8 @@ usage(void) int main(int argc, char *argv[]) { - if (argc > 1) { - usage(); - } else if (argc == 1) { - argv0 = argv[0]; - } + if (argc > 0) argv0 = argv[0]; + if (argc > 1) usage(); if (send_command(0, NULL)) return errno ? (perror(argv0), 1) : 3; @@ -59,11 +59,8 @@ usage(void) int main(int argc, char *argv[]) { - if (argc > 1) { - usage(); - } else if (argc == 1) { - argv0 = argv[0]; - } + if (argc > 0) argv0 = argv[0]; + if (argc > 1) usage(); if (send_command(1, NULL)) return errno ? (perror(argv0), 1) : 3; diff --git a/src/satrm.c b/src/satrm.c index 36a8b26..e1280bc 100644 --- a/src/satrm.c +++ b/src/satrm.c @@ -60,10 +60,8 @@ usage(void) int main(int argc, char *argv[]) { - if (argc != 2) { - usage(); - } - argv0 = argv[0]; + if (argc > 0) argv0 = argv[0]; + if (argc != 2) usage(); if (send_command(0, argv[1])) return errno ? (perror(argv0), 1) : 3; |