Make 1994/tvr alt code use fgets()

This means that one of the bug statuses was removed.
This commit is contained in:
Cody Boone Ferguson committed 2024-01-16 06:15:14 -08:00
1 parent a438eb468f
commit 329e9470be
4 files changed
+5 -12

No files matched your search

+1 -2
View File
@@ -15,7 +15,6 @@ The current status of this entry is:
``` ```
STATUS: known bug - please help us fix STATUS: known bug - please help us fix
STATUS: uses gets() - change to fgets() if possible
``` ```
For more detailed information see [1994 tvr in bugs.md](/bugs.md#1994-tvr). For more detailed information see [1994 tvr in bugs.md](/bugs.md#1994-tvr).
@@ -46,7 +45,7 @@ The author provided us a spoiler version that might be of interest to some.
### Alternate build: ### Alternate build:
```sh ```sh
make tvr.alt make alt
``` ```
+2 -1
View File
@@ -1,5 +1,6 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#define M typedef #define M typedef
#define gets(B) fgets((B),C-(B)+256,stdin),(B[strlen(B)-1]='\0'),1
#define N( a)=r=(a)+j #define N( a)=r=(a)+j
#define S f(; G; )D[B[H=i[--G]]=F+=F<p]++ #define S f(; G; )D[B[H=i[--G]]=F+=F<p]++
#define f for #define f for
@@ -60,7 +61,7 @@ K ()
_ _
I (d F) I (d F)
{ {
F || gets (F = B); F || (gets (B),F=B);
y = atoi (F); y = atoi (F);
} }
_ _
-6
View File
@@ -1459,12 +1459,6 @@ You are welcome to try and fix it and open a pull request, providing that it
doesn't break something else. doesn't break something else.
### STATUS: uses gets() - change to fgets() if possible
Although the entry itself was changed to use `fgets(3)` the alt code was not. It
would be better if both used `fgets(3)`.
# 1995 # 1995
+2 -3
View File
@@ -1963,9 +1963,8 @@ check the [bugs.md](bugs.md) file.
[Cody](#cody) made this use `fgets(3)` instead of `gets(3)`. In this case the newline had [Cody](#cody) made this use `fgets(3)` instead of `gets(3)`. In this case the newline had
to be terminated but it was a pretty straightforward fix. `gets()` was defined to be terminated but it was a pretty straightforward fix. `gets()` was defined
to use `fgets()` and the inclusion of `stdio.h` had to be added but to make it to use `fgets()` and the inclusion of `stdio.h` had to be added but to make it
more like the original entry this was done in the Makefile. more like the original entry this was done in the Makefile. The alt code was
also changed to use `fgets(3)`.
Note that the alt code does not use `fgets(3)` but rather `gets(3)`.
## <a name="1994_weisberg"></a>[1994/weisberg](/1994/weisberg/weisberg.c) ([README.md](/1994/weisberg/README.md])) ## <a name="1994_weisberg"></a>[1994/weisberg](/1994/weisberg/weisberg.c) ([README.md](/1994/weisberg/README.md]))