Make 1990/tbr alt version that uses fgets not gets

This is so that the warning about gets() is not interspersed with the
initial output of the program (see below). I do want to note that if one
sends EOF it will segfault so to exit one should do ctrl-c (for
instance) (exit never worked). I will look at fixing that fault later on
to match the original code but this is good for now. When fixed (low
priority though) I will consider making the gets() version the alt but
probably not (I guess time will tell).

As for the interspersed output it looks like:

    $ warning: this program uses gets(), which is unsafe.
    # cursor is here

At the cursor I can either hit enter to get another prompt or I can
input a command but this is not immediately obvious.

Updated .gitignore to have tbr.alt.
This commit is contained in:
Cody Boone Ferguson committed 2023-03-21 05:58:50 -07:00
1 parent e6d578660b
commit 6a6807e587
4 files changed
+45 -4

No files matched your search

+3 -3
View File
@@ -98,7 +98,7 @@ CDEFINE=
# Include files that are needed to compile
#
CINCLUDE=
CINCLUDE= -include stdio.h
#CINCLUDE= -include stdlib.h
#CINCLUDE= -include stdio.h
#CINCLUDE= -include stdlib.h -include stdio.h
@@ -168,8 +168,8 @@ OBJ= ${PROG}.o
DATA=
TARGET= ${PROG}
#
ALT_OBJ=
ALT_TARGET=
ALT_OBJ= ${PROG}.alt.o
ALT_TARGET= ${PROG}.alt
#################