Oops. Thanks Ethan. I meant it to be 
if (! strstr(argv[1], ".cfg"))