Make 1987/wall use fgets() not gets()

Added in README.md a diff so one can see how it was done.
This commit is contained in:
Cody Boone Ferguson committed 2023-03-21 10:16:00 -07:00
1 parent 005fd79916
commit 31ee47176c
2 files changed
+13 -2

No files matched your search

+11
View File
@@ -9,6 +9,17 @@ Panorama City, CA 91402 USA
make all
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) made this entry safer
by changing `gets()` to `fgets()`. Thank you Cody for your assistance! If you
wish for the original unsafe version you can make the following change:
-signal())();char*V,cm,D['x'],M='\n',I;L(MV,V,(c+='d',ix))m(x){v)
+signal())();char*V,cm,D['x'],M='\n',I,*gets();L(MV,V,(c+='d',ix))m(x){v)
signal(X/'I',vi[x]);}d(x)char*x;{v)write(i,x,i);}L(MC,V,M+I)xv(){c>=i?m(
c/M/M+M):(d(&M),m(cm));}L(mi,V+cm,M)L(md,V,M)MM(){c=c*M%X;V-=cm;m(ix);}
-LXX(){fgets(D,'x',stdin)||(vi[iv])();c=atoi(D);while(c>=X){c-=X;d("m");}V="ivxlcdm"
+LXX(){gets(D)||(vi[iv])();c=atoi(D);while(c>=X){c-=X;d("m");}V="ivxlcdm"
## To run: