From b34b47c2f2e151ee19a6eb37ca1da75d01888b06 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 23 Mar 2023 17:36:56 -0700 Subject: [PATCH] Make 1993/schnitzi use fgets() not gets() --- 1993/schnitzi/README.md | 3 +++ 1993/schnitzi/schnitzi.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/1993/schnitzi/README.md b/1993/schnitzi/README.md index 5a148f35f..24516cb0c 100644 --- a/1993/schnitzi/README.md +++ b/1993/schnitzi/README.md @@ -9,6 +9,9 @@ make all +[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) made this use `fgets()` +not `gets()` to make it safer. Thank you Cody for your assistance! + ### To run ./schnitzi file diff --git a/1993/schnitzi/schnitzi.c b/1993/schnitzi/schnitzi.c index 584e752dc..55c4232b3 100644 --- a/1993/schnitzi/schnitzi.c +++ b/1993/schnitzi/schnitzi.c @@ -30,6 +30,6 @@ ) printf ( " %s",li1[l1l++] ) ;puts ( "." ) ;}}else{sprintf ( il1,"cat %s;echo",lll[1] ) ;system ( il1 ) ;}printf -( "\n? " ) ;gets ( il1 +( "\n? " ) ; fgets ( il1, 111 , stdin ) ;sprintf ( i1l,"%s %s %s",lll[!1 ] ,lll[1],il1);system ( i1l); }