Fix 1994/horton - check args

This commit is contained in:
Cody Boone Ferguson committed 2023-10-30 05:41:15 -07:00
1 parent 51d1e9e4c4
commit d629239eef
5 files changed
+9 -32

No files matched your search

+2 -2
View File
@@ -59,11 +59,11 @@ ARCH=
# Defines that are needed to compile # Defines that are needed to compile
# #
CDEFINE= CDEFINE= -DE='exit(1)' -DA=argc
# Include files that are needed to compile # Include files that are needed to compile
# #
CINCLUDE= CINCLUDE= -include stdlib.h
# Optimization # Optimization
# #
-17
View File
@@ -11,17 +11,6 @@ make all
``` ```
### Bugs and (Mis)features
The current status of this entry is:
```
STATUS: known bug - please help us fix
```
For more detailed information see [1994 horton in bugs.md](/bugs.md#1994-horton).
## To use: ## To use:
```sh ```sh
@@ -30,12 +19,6 @@ For more detailed information see [1994 horton in bugs.md](/bugs.md#1994-horton)
`A`, `B`, `C` and `D` are numeric arguments. `A`, `B`, `C` and `D` are numeric arguments.
### INABIAF - it's not a bug it's a feature! :-)
Running this program without enough args will very likely crash or do something
else.
## Try:
```sh ```sh
./horton 3 2 1 0 ./horton 3 2 1 0
+1 -1
View File
@@ -1,6 +1,6 @@
#define S(r, c) f[r][c] = 1; #define S(r, c) f[r][c] = 1;
char f[96][160]; main(argc, argv) char **argv; { double x, y, atof(); int char f[96][160]; main(argc, argv) char **argv; {if(A<5)E;double x, y; int
r , r ,
c , c ,
bi , bi ,
-12
View File
@@ -832,18 +832,6 @@ An alternate version, however, does exist. See the README.md file for details.
# 1994 # 1994
## 1994 horton
### STATUS: known bug - please help us fix
### Source code: [1994/horton/horton.c](1994/horton/horton.c)
### Information: [1994/horton/README.md](1994/horton/README.md)
If not enough args are specified this program will likely crash or do something
else.
If you want to try and fix this (mis)feature, you are welcome to try.
## 1994 ldb ## 1994 ldb
### STATUS: INABIAF - please **DO NOT** fix ### STATUS: INABIAF - please **DO NOT** fix
+6
View File
@@ -1289,6 +1289,12 @@ arg (as it was 0 at file scope already this is perfectly fine and it means
there's no need to cast it to an int in the function call though that would also there's no need to cast it to an int in the function call though that would also
work). work).
## [1994/horton](1994/horton/horton.c) ([README.md](1994/horton/README.md))
Cody fixed this to check that four args were specified. With the use of the C
pre-processor macro and inclusion of stdlib.h in the Makefile the layout of the
source is exactly the same column width and no additional lines were added.
## [1994/ldb](1994/ldb/ldb.c) ([README.md](1994/ldb/README.md])) ## [1994/ldb](1994/ldb/ldb.c) ([README.md](1994/ldb/README.md]))