diff --git a/1984/laman/Makefile b/1984/laman/Makefile index 15dfc37eb..2333fef2f 100644 --- a/1984/laman/Makefile +++ b/1984/laman/Makefile @@ -159,8 +159,6 @@ all: data ${TARGET} supernova deep_magic magic charon pluto ${PROG}: ${PROG}.c - @echo "NOTE: this entry will likely dump core without an arg and it will not work without" - @echo "a positive number." ${CC} ${CFLAGS} $< -o $@ ${LIBS} # alternative executable diff --git a/1984/laman/README.md b/1984/laman/README.md index 1f0c6401a..930c100de 100644 --- a/1984/laman/README.md +++ b/1984/laman/README.md @@ -10,9 +10,13 @@ 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! + ## Try: -The program accepts ONE positive argument. Seeing is believing, so try things +The program accepts ONE POSITIVE argument. Seeing is believing, so try things like: ./laman 4 @@ -21,9 +25,6 @@ like: This code should run you in circles. -NOTE: this program will likely segfault if you do not provide an argument and it -will not print anything if the number is not positive or not a number. - ## Judges' comments: Some new compilers dislike lines 6 and 10 of the source, so we changed diff --git a/1984/laman/laman.c b/1984/laman/laman.c index 758e4480c..9ce1e4c11 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= atoi(* ++l); for(k= +l)char* *l;{g= l[1]? atoi(*++l) :0;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