diff --git a/2006/stewart/README.md b/2006/stewart/README.md index 8154aa3f1..e1a46c56e 100644 --- a/2006/stewart/README.md +++ b/2006/stewart/README.md @@ -10,17 +10,6 @@ make ``` -### Bugs and (Mis)features - -The current status of this entry is: - -``` -STATUS: known bug - please help us fix -``` - -For more detailed information see [2006 stewart in bugs.md](/bugs.md#2006-stewart). - - ## To use: ```sh @@ -48,11 +37,6 @@ where `FILE` is one of: spirals4 squares stars stars2 tree tree2 tree3 tree4 triangle -### INABIAF - it's not a bug it's a feature! :-) - -This program will very likely crash or do something funny if the file does not -exist or cannot be opened. - ## Judges' remarks: Note the interesting choice of using a `#define` in the output. diff --git a/2006/stewart/stewart.c b/2006/stewart/stewart.c index 02103ec9e..8b27aec4b 100644 --- a/2006/stewart/stewart.c +++ b/2006/stewart/stewart.c @@ -20,6 +20,7 @@ int main(int c,char**o) Z(v,6)=(long)malloc(Z(v,0)); memset((void*)Z(v,6),0,Z(v,0)); Z(v,13)=(long)fopen(o[3],"r"); + if(F(v,13)==NULL)P("file doesn't exist\n"), exit(1); fscanf(F(v,13),"%ld",(long*)Y(v,3)); Z(v,8)=(long)malloc(050+Z(v,3)*070); Z(Z(v,8),0)=Z(v,3); diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index d0fca688d..9e5151303 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -2154,6 +2154,11 @@ Since the author suggested that the lack of certain `#include`s might break the program in some systems he added `-include ...` to the Makefile as well. +## [2006/stewart](2006/stewart/stewart.c) ([README.md](2006/stewart/README.md])) + +Cody fixed it so that if the file cannot be opened it exits rather than trying +to read from the file. + ## [2006/toledo2](2006/toledo2/toledo2.c) ([README.md](2006/toledo2/README.md])) Cody fixed a segfault in this program which was making it fail to work under