diff --git a/1992/westley/README.md b/1992/westley/README.md index a28c09d7d..53a235dda 100644 --- a/1992/westley/README.md +++ b/1992/westley/README.md @@ -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 diff --git a/1992/westley/westley.c b/1992/westley/westley.c index 2fe9a369c..f669a8457 100644 --- a/1992/westley/westley.c +++ b/1992/westley/westley.c @@ -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\ + ,a)char**a;{int n;int d; +if (l>2)for(d=atoi(a[1])/10 +*80-atoi(a[2])/5-596;n="@NKA\ CLCCGZAAQBEAADAFaISADJABBA^\ SNLGAQABDAXIMBAACTBATAHDBAN\ ZcEMMCCCCAAhEIJFAEAAABAfHJE\