Improve my fix to 2000/anderson - redefine gets()
This commit is contained in:
1 parent
8aad81aaeb
commit
88eef478aa
2 files changed
+9
-10
No files matched your search
@@ -1,5 +1,5 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#define gets(K) fgets((K)[1],1000,stdin)
|
||||||
char
|
char
|
||||||
*T="IeJKLMaYQCE]jbZRskc[SldU^V\\X\\|/_<[<:90!\"$434-./2>]s",
|
*T="IeJKLMaYQCE]jbZRskc[SldU^V\\X\\|/_<[<:90!\"$434-./2>]s",
|
||||||
K[3][1000],*F,x,A,*M[2],*J,r[4],*g,N,Y,*Q,W,*k,q,D;X(){r [r
|
K[3][1000],*F,x,A,*M[2],*J,r[4],*g,N,Y,*Q,W,*k,q,D;X(){r [r
|
||||||
@@ -25,15 +25,12 @@ j((r[2]=0,R( ))
|
|||||||
),r[1]-=q) &&
|
),r[1]-=q) &&
|
||||||
O(g-=-q) ;}
|
O(g-=-q) ;}
|
||||||
C(){( J=
|
C(){( J=
|
||||||
fgets (K
|
gets (&K
|
||||||
[1],1000,stdin))&&C((B(g=K[2]),*r=!(!*r&&(*g++=0)),(*r)[r]=g
|
[1]))&&C((B(g=K[2]),*r=!(!*r&&(*g++=0)),(*r)[r]=g-K[2],g=K[2
|
||||||
-K[2
|
],r[
|
||||||
],g=
|
1]&&
|
||||||
K[2]
|
O())
|
||||||
,r[1
|
);;}
|
||||||
]&&O
|
|
||||||
()))
|
|
||||||
;;}
|
|
||||||
main
|
main
|
||||||
(){C
|
(){C
|
||||||
((l(
|
((l(
|
||||||
|
|||||||
@@ -856,6 +856,8 @@ Cody changed this entry to use `fgets()` instead of `gets()` to make it safer
|
|||||||
and to prevent annoying warnings from showing up at compiling, linking and/or
|
and to prevent annoying warnings from showing up at compiling, linking and/or
|
||||||
runtime, the latter interspersed with the output of the program.
|
runtime, the latter interspersed with the output of the program.
|
||||||
|
|
||||||
|
Cody later improved the fix to use `gets()` by redefining `gets()` so that the
|
||||||
|
code looks like before.
|
||||||
|
|
||||||
## [2000/briddlebane](2000/briddlebane/briddlebane.c) ([README.md](2000/briddlebane/README.md]))
|
## [2000/briddlebane](2000/briddlebane/briddlebane.c) ([README.md](2000/briddlebane/README.md]))
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user