From 51d1e9e4c467a77c0dd82a7c4e211cc67fb13002 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Mon, 30 Oct 2023 05:10:20 -0700 Subject: [PATCH] Additional fix 2001/cheong - check args --- 2001/cheong/README.md | 16 ---------------- 2001/cheong/cheong.c | 2 +- bugs.md | 11 ----------- thanks-for-fixes.md | 1 + 4 files changed, 2 insertions(+), 28 deletions(-) diff --git a/2001/cheong/README.md b/2001/cheong/README.md index 48b019dc1..d2512f4f7 100644 --- a/2001/cheong/README.md +++ b/2001/cheong/README.md @@ -11,28 +11,12 @@ US\ make ``` - -### Bugs and (Mis)features - -The current status of this entry is: - -``` -STATUS: known bug - please help us fix -``` - -For more detailed information see [2001 cheong in bugs.md](/bugs.md#2001-cheong). - - ## To use: ```sh ./cheong digits ``` -### INABIAF - it's not a bug it's a feature! :-) - -This program will very likely crash or do something different without an arg. - ## Try: diff --git a/2001/cheong/cheong.c b/2001/cheong/cheong.c index 97fef5f18..e229488ba 100644 --- a/2001/cheong/cheong.c +++ b/2001/cheong/cheong.c @@ -11,4 +11,4 @@ c=o+ (D[I]+82)%10-(I>l/2)* :!(o=pain(c/10,O,I-1))*((c+999 )%10-(D[I]+92)%10);}return o;} int main(int o,char **O) { -return pain(o, O, l); } +return o>1?pain(o, O, l):1; } diff --git a/bugs.md b/bugs.md index 750254b9d..944c760c9 100644 --- a/bugs.md +++ b/bugs.md @@ -1262,17 +1262,6 @@ and it can be run by itself for fun in modern systems, which was not possible before the fixes there. -## 2001 cheong - -### STATUS: known bug - please help us fix -### Source code: [2001/cheong/cheong.c](2001/cheong/cheong.c) -### Information: [2001/cheong/README.md](2001/cheong/README.md) - -This program will very likely crash or do something different without an arg. - -If you want to try and fix this (mis)feature, you are welcome to try. - - ## 2001 dgbeards ### STATUS: INABIAF - please **DO NOT** fix diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 00be616fe..8c8300fbe 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -1751,6 +1751,7 @@ letter word that would match the format and because it's pain that clang forces this. :-) This fix makes a point of the author's notes on portability no longer valid, btw. +He also fixed it to check the number of args. ## [2001/coupard](2001/coupard/coupard.c) ([README.md](2001/coupard/README.md]))