5 Commits
Author SHA1 Message Date
Cody Boone Ferguson 44728e695b Fix fix on fix of 1990/tbr
When I added the 'gets()' and 'exit()' macros to make the code look more
like the original I accidentally left out a space between 'gets(x)' and
'fgets(...' so that it looked like:

    #define gets(x)fgets((x),512,stdin)

which I believe is incorrect. It now looks instead like:

    #define gets(x) fgets((x),512,stdin)

The compact version that the authors provided was compile fixed quite
some time back but I never added the exit macro to match the original
more closely.

Also since the compact version was meant to be identical in function of
the entry and since that entry was changed to use fgets() (by the macro
gets()) I decided it would be better to make it use fgets() also, also
through redefining gets(). To make the line length closer in match to
the original compact version I changed the code to be two lines. This
wasn't necessary to do, as I recall, in the entry itself though it's
possible it was and I just managed to get the ASCII art the same or
almost the same.

The thanks-for-fixes.md file was updated for this change but
unfortunately I had made some changes yesterday that I forgot about
(just rewording) in another entry so that will also be in this commit.
2023-10-11 03:09:57 -07:00
Cody Boone Ferguson 5ae02fd2c9 Actually add 1990/tbr/tbr.alt.c to repo 2023-09-26 11:27:13 -07:00
Cody Boone Ferguson 48751e845c Remove alt code of 1990/tbr
Instead link to archive tarball. The alt code is just the gets() version
and it was decided that that should not normally be in the entry
directory.
2023-04-08 03:10:44 -07:00
Cody Boone Ferguson e317048e21 Fix segfault in tbr.alt.c, swap tbr.alt.c code
The segfault has been fixed when EOF is sent to the program (causing
fgets() to return NULL).

Since fgets() is far safer than gets() and since the gets() version will
intersperse the warning and the first line of output I have changed the
alt version to be the original (fixed to compile with modern compilers)
and the tbr is the one with fgets().
2023-03-21 07:33:00 -07:00
Cody Boone Ferguson 6a6807e587 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.
2023-03-21 05:58:50 -07:00