From 4e6630575c7b777c05f27a8fdaaa644cdb53d657 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 7 Apr 2023 10:42:42 -0700 Subject: [PATCH] Undo NULL file check in 1993/schnitzi As part of the redefinition of INABIAF the NULL file check has been removed. Instead it's noted in the README.md and Makefile. --- 1993/schnitzi/Makefile | 1 + 1993/schnitzi/README.md | 17 +++++++++-------- 1993/schnitzi/schnitzi.c | 4 ++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/1993/schnitzi/Makefile b/1993/schnitzi/Makefile index 27f04ced1..345b26c31 100644 --- a/1993/schnitzi/Makefile +++ b/1993/schnitzi/Makefile @@ -128,6 +128,7 @@ all: data ${TARGET} supernova deep_magic magic charon pluto ${PROG}: ${PROG}.c + @echo "NOTE: this entry will segfault if the file cannot be opened." ${CC} ${CFLAGS} $< -o $@ ${LIBS} # alternative executable diff --git a/1993/schnitzi/README.md b/1993/schnitzi/README.md index 49ae8ccc0..5b92d982e 100644 --- a/1993/schnitzi/README.md +++ b/1993/schnitzi/README.md @@ -1,18 +1,17 @@ # Obfuscated Intelligence Award: - Mark Schnitzius - 1700 Woodbury Rd. #1208 - Orlando, FL 32828 - USA +Mark Schnitzius +1700 Woodbury Rd. #1208 +Orlando, FL 32828 +USA ## To build: make all -[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this to not -segfault when no file is specified or the file cannot be opened for reading. He -also made this use `fgets()` not `gets()` to make it safer. Thank you Cody for -your assistance! +[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) made this use `fgets()` +not `gets()` to make it safer and to prevent a warning with linking or at +runtime. Thank you Cody for your assistance! ## To run: @@ -22,6 +21,8 @@ where: file a file containing some text +NOTE: this entry will segfault if the file cannot be opened. + ## Try: ./schnitzi schnitzi.info diff --git a/1993/schnitzi/schnitzi.c b/1993/schnitzi/schnitzi.c index a51e8ab4c..55c4232b3 100644 --- a/1993/schnitzi/schnitzi.c +++ b/1993/schnitzi/schnitzi.c @@ -13,9 +13,9 @@ ( lll>l1 ) li|=! ( l[3*l1+++3 ] -ll[strlen ( ll)-1] ) ;return ( li ) ;}main ( ll,lll - ) char*lll[];{if(ll<2)return 1;char l1 [111][21], li1[111][21],il1[111],i1l + ) char*lll[];{char l1 [ 111][21],li1[111][21 ] ,il1[111],i1l [ 111 ] ;int lli,l11,l1l,li/* ( */,ll1,il,l;FILE*f;if(ll-2 - ) {f=fopen ( lll[1],"r" );if(!f)return 1;lli=l=ll1=il=!1;while + ) {f=fopen ( lll[1],"r" ) ;lli=l=ll1=il=!1;while ( fscanf(f,"%s",l1[lli] ) +1){li=ii ( l1[lli],3 ) ;iii ( l1[lli] ) ;l1l=l11=!1;while ( l1l>-ll ) {iii ( lll[-l1l]