From 7cbae5d7e6d3b3630af4eebf230dbdf83f89cbbb Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Mon, 2 Sep 2013 08:05:13 -0400 Subject: [PATCH] make sure an input file is specified --- undpu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/undpu.c b/undpu.c index 6cd3ce6..6aa532a 100755 --- a/undpu.c +++ b/undpu.c @@ -9,6 +9,10 @@ int main (int argc, char **argv){ FILE *bob, *joe; int factor, thing, i; char output[FILENAME_MAX]; + if(argc < 2){ + fputs("I pity the fool who don't have an input file!\n",stderr); + return EXIT_FAILURE; + } if((bob = fopen(argv[1],"r"))==NULL){ fputs("That's no input file, THAT'S A SPACE STATION!\n",stderr); return EXIT_FAILURE;