From ec111eb6b2b46847c4b3e18c880c05c5708a63a8 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 7 Apr 2023 10:15:16 -0700 Subject: [PATCH] Undo segfault fix in 1984/laman w/o arg As part of redefining INABIAF this is necessary. The README.md and Makefile both warn about the crash. --- 1984/laman/Makefile | 1 + 1984/laman/README.md | 6 +++--- 1984/laman/laman.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/1984/laman/Makefile b/1984/laman/Makefile index 24f29119b..13746a975 100644 --- a/1984/laman/Makefile +++ b/1984/laman/Makefile @@ -128,6 +128,7 @@ all: data ${TARGET} supernova deep_magic magic charon pluto ${PROG}: ${PROG}.c + @echo "NOTE: this entry will segfault without an arg." ${CC} ${CFLAGS} $< -o $@ ${LIBS} # alternative executable diff --git a/1984/laman/README.md b/1984/laman/README.md index 162ce2062..d8fb88eaa 100644 --- a/1984/laman/README.md +++ b/1984/laman/README.md @@ -10,9 +10,9 @@ Mike Laman ./laman -[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this entry to not -segfault if no arg is specified. Instead it'll print nothing. Thank you Cody for -your assistance! + +NOTE: this entry will segfault without an arg. + ## Try: diff --git a/1984/laman/laman.c b/1984/laman/laman.c index 9ce1e4c11..758e4480c 100644 --- a/1984/laman/laman.c +++ b/1984/laman/laman.c @@ -1,5 +1,5 @@ a[900]; b;c;d=1 ;e=1;f; g;h;O; main(k, -l)char* *l;{g= l[1]? atoi(*++l) :0;for(k= +l)char* *l;{g= atoi(* ++l); for(k= 0;k*k< g;b=k ++>>1) ;for(h= 0;h*h<= g;++h); --h;c=( (h+=g>h *(h+1)) -1)>>1; while(d <=g){ ++O;for (f=0;f< O&&d<=g