Fix fix on 1990/dds + make it use fgets()
The Makefile had -include stdio.h which made it fail to compile under macOS (mismatch type of fopen()). I removed the prototype in the code. I also made it use fgets() instead of gets() to make it safer.
This commit is contained in:
1 parent
655815769b
commit
5873c7cedc
3 files changed
+11
-8
No files matched your search
+6
-3
@@ -14,14 +14,15 @@
|
||||
[Yusuke Endoh](/winners.html#Yusuke_Endoh) fixed this for modern systems. Thank
|
||||
you Yusuke!
|
||||
|
||||
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) removed the erroneous
|
||||
prototype to `fopen()` and made this use `fgets()` instead of `gets()` to make
|
||||
it safer. Thank you Cody for your assistance!
|
||||
|
||||
### To run
|
||||
|
||||
./dds
|
||||
|
||||
|
||||
NOTE: this entry uses `gets()` so you might get a warning when compiling and
|
||||
running this entry.
|
||||
|
||||
### Try:
|
||||
|
||||
Give the following lines as input:
|
||||
@@ -31,6 +32,8 @@ Give the following lines as input:
|
||||
|
||||
NOTE: this is case sensitive.
|
||||
|
||||
NOTE: this program will likely segfault if you specify a file that cannot be
|
||||
opened.
|
||||
|
||||
## Judges' comments:
|
||||
|
||||
|
||||
Reference in new issue
Block a user