make sure there's a .dpu suffix on the input file

remotes/1720846149120324653/tmp_refs/heads/master
Jonathan Lamothe 11 years ago
parent 7cbae5d7e6
commit 8351f8e943
  1. 5
      undpu.c

@ -13,6 +13,11 @@ int main (int argc, char **argv){
fputs("I pity the fool who don't have an input file!\n",stderr); fputs("I pity the fool who don't have an input file!\n",stderr);
return EXIT_FAILURE; return EXIT_FAILURE;
} }
if(strlen(argv[1]) <= 4 || strcmp(argv[1] + strlen(argv[1]) - 4, ".dpu"))
{
fputs("Where's the rest of the filename?", stderr);
return EXIT_FAILURE;
}
if((bob = fopen(argv[1],"r"))==NULL){ if((bob = fopen(argv[1],"r"))==NULL){
fputs("That's no input file, THAT'S A SPACE STATION!\n",stderr); fputs("That's no input file, THAT'S A SPACE STATION!\n",stderr);
return EXIT_FAILURE; return EXIT_FAILURE;

Loading…
Cancel
Save