Improve my fix to 1993/schnitzi
Redefined gets() so that the code can refer to gets() not fgets(). That change was useful (as noted before) for preventing an annoying warning being interspersed with the output and warnings at compiler and/or linking.
This commit is contained in:
1 parent
e68f6678e2
commit
8aad81aaeb
2 files changed
+4
-2
No files matched your search
@@ -2,7 +2,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#define gets(x) fgets((x), 111, stdin)
|
||||
#define iii\
|
||||
( I ) if ( ii(I,6\
|
||||
) )I [ strlen(I ) -1]=!1
|
||||
@@ -30,6 +30,6 @@
|
||||
) printf ( " %s",li1[l1l++] ) ;puts
|
||||
( "." ) ;}}else{sprintf ( il1,"cat %s;echo",lll[1]
|
||||
) ;system ( il1 ) ;}printf
|
||||
( "\n? " ) ; fgets ( il1, 111 , stdin
|
||||
( "\n? " ) ; gets ( il1
|
||||
) ;sprintf ( i1l,"%s %s %s",lll[!1 ] ,lll[1],il1);system
|
||||
( i1l); }
|
||||
@@ -663,6 +663,8 @@ Cody made this use `fgets()` not `gets()` to make it safer and to prevent an
|
||||
annoying warning with compiling and/or linking and/or runtime, the latter of
|
||||
which is unfortunately interspersed with the output of the program itself.
|
||||
|
||||
Cody later improved the fix to use `gets()` via a macro so that it looks like
|
||||
the original code.
|
||||
|
||||
## [1993/vanb](1993/vanb/vanb.c) ([README.md](1993/vanb/README.md]))
|
||||
|
||||
|
||||
Reference in new issue
Block a user