Most of the time I keep away from C with manipulating/testing strings, but this time I do
need to do it.
I'm using strcasecmp::
char *buf[50];
fgets(buf,50,stdin);
if (strcasecmp(buf,"quit"
== 0) {
do_cleanup(fd1,fd2,arrayname)
} else {
etc..
Line no 1: quit
Array storage quit
0
Line no 2: quit
Array storage quit
0
Line no 3: quit
Array storage quit
0
Line no 4: QUIT
Array storage QUIT
0
According to the man pages this should not happen.
Any ideas?
need to do it.
I'm using strcasecmp::
char *buf[50];
fgets(buf,50,stdin);
if (strcasecmp(buf,"quit"
do_cleanup(fd1,fd2,arrayname)
} else {
etc..
Line no 1: quit
Array storage quit
0
Line no 2: quit
Array storage quit
0
Line no 3: quit
Array storage quit
0
Line no 4: QUIT
Array storage QUIT
0
According to the man pages this should not happen.
Any ideas?