k9core

Unnamed repository
Log | Files | Refs | LICENSE

commit 61a4887fb1124906d732c999461727505dd7a04a
parent 0d9b8f25519f52cac50d0e1eb30ee78a2ed86cf7
Author: qorg11 <qorg@vxempire.xyz>
Date:   Sun,  2 Aug 2020 22:05:55 +0200

modified kill.c so doesn't use getopt (which in this case
was a complete overkill). Also a warning if nothing given.

Diffstat:
Msrc/kill.c | 9++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/kill.c b/src/kill.c @@ -1,7 +1,6 @@ #include <stdio.h> #include <stdlib.h> #include <signal.h> -#include <getopt.h> void list_signals(void) @@ -27,8 +26,12 @@ main(int argc, char *argv[]) int sig = 0; pid_t pid; - int c = getopt(argc, argv,"l"); - if(c == 'l') + if(argc == 1) + { + fprintf(stderr,"expected something\n"); + return 1; + } + if(argv[1][1] == 'l') { list_signals(); return 0;