Fix segfault in 1992/westley without enough args

This commit is contained in:
Cody Boone Ferguson committed 2023-03-26 15:07:35 -07:00
1 parent e529db9865
commit 04b2b59797
2 files changed
+5 -3

No files matched your search

+3 -1
View File
@@ -15,7 +15,9 @@
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this for clang by
changing the third and fourth arg of main() to be ints inside main(); clang
requires args 2 - 4 to be `char **`. Thank you Cody for your assistance!
requires args 2 - 4 to be `char **`. He also fixed it so that the program would
not segfault if not enough args were specified. Thank you Cody for your
assistance!
### To run
+2 -2
View File
@@ -1,7 +1,7 @@
main(l
,a)char**a;{int n;int d;
for(d=atoi(a[1])/10*80-
atoi(a[2])/5-596;n="@NKA\
if (l>2)for(d=atoi(a[1])/10
*80-atoi(a[2])/5-596;n="@NKA\
CLCCGZAAQBEAADAFaISADJABBA^\
SNLGAQABDAXIMBAACTBATAHDBAN\
ZcEMMCCCCAAhEIJFAEAAABAfHJE\