From 965759365d872c32cb0cd297f6cc1b8a68568052 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 7 Apr 2023 10:59:36 -0700 Subject: [PATCH] Add note about fgets() in 1990/cmills About why it's useful. It's both a problem to keep gets() but it's also potentially a problem to change it to fgets(). But as it will prevent alarming the user with warnings about gets() and also causing messed up output (see below) this is useful. With the original code one will see under macOS something like: $ ./cmills.alt Shuffle... warning: this program uses gets(), which is unsafe. Total $1000. Wager? which is very wrong. I did not delete the cmills.alt.c but perhaps it should be deleted. That can come another time. --- 1990/cmills/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/1990/cmills/README.md b/1990/cmills/README.md index 7aab5822b..1ffc1057d 100644 --- a/1990/cmills/README.md +++ b/1990/cmills/README.md @@ -23,7 +23,8 @@ work in modern systems (it resulted in a bus error otherwise). Thank you Yusuke for your assistance! [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) made this safer by -using `fgets()` instead of `gets()`. Thank you Cody! +using `fgets()` instead of `gets()`. This avoids a potentially alarming warning +at linking or runtime. Thank you Cody for your assistance! The original bug fixed version is in [cmills.alt.c](cmills.alt.c), described in the `Alternate code` section.