diff --git a/1990/westley/README.md b/1990/westley/README.md index c783b3654..fa3733e6b 100644 --- a/1990/westley/README.md +++ b/1990/westley/README.md @@ -15,30 +15,13 @@ make all ``` -### Bugs and (Mis)features - -The current status of this entry is: - -``` -STATUS: known bug - please help us fix -``` - -For more detailed information see [1990 westley in bugs.md](/bugs.md#1990-westley). - - ## To use: ```sh -./westley number +./westley 0. - +The number should be greater than 0. ## Try: diff --git a/1990/westley/westley.c b/1990/westley/westley.c index 70f787618..5362c1eb8 100644 --- a/1990/westley/westley.c +++ b/1990/westley/westley.c @@ -11,6 +11,7 @@ char*lie; dear; (char)lotte--; + if (ly < 2 || atoi(die[1])<1) exit(1); for(get= !me;; not){ 1 - out & out ;lie;{ diff --git a/bugs.md b/bugs.md index bc5ab5a68..487c9a485 100644 --- a/bugs.md +++ b/bugs.md @@ -634,19 +634,6 @@ will enter an infinite loop, printing 0 over and over again; another condition where this occurred was fixed but this one should not be fixed. Thank you. -## 1990 westley - -### STATUS: known bug - please help us fix -### Source code: [1990/westley/westley.c](1990/westley/westley.c) -### Information: [1990/westley/README.md](1990/westley/README.md) - -This entry will very likely crash or do something strange without an arg. - -This entry will also enter an infinite loop if input is not a number > 0. - -If you want to try and fix this (mis)feature, you are welcome to try. - - # 1991 diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 3234db882..75dc48cd4 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -1015,6 +1015,11 @@ was changed to just `1`. Since it's instructional to see the differences he has provided an alternate version, [westley.alt.c](1990/westley/westley.alt.c), which is the original code. +He also fixed the code to not enter an infinite loop if arg is a number not > 0 +and to not crash if no arg is specified. + +The alt code did NOT have arg checks added as it is actually a copy of the +original code. ## [1991/brnstnd](1991/brnstnd/brnstnd.c) ([README.md](1991/brnstnd/README.md]))