From 87248c46ffda6311fa6477ca8de2e37f10a8f0d8 Mon Sep 17 00:00:00 2001 From: jaseg Date: Sun, 22 Jul 2018 20:43:56 +0200 Subject: Fix variable scope bug --- lolcat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lolcat.c b/lolcat.c index ad1893b..6e6ffba 100644 --- a/lolcat.c +++ b/lolcat.c @@ -74,6 +74,7 @@ void version(){ } int main(int argc, char **argv){ + char *default_argv[] = {"-"}; int cc=-1, i, l=0; wint_t c; int colors=1; @@ -115,8 +116,7 @@ int main(int argc, char **argv){ char **inputs = argv+i; char **inputs_end = argv+argc; if(inputs == inputs_end){ - char *foo[] = {"-"}; - inputs = foo; + inputs = default_argv; inputs_end = inputs+1; } -- cgit