/* Checks filename for extension, and adds it if it isn't in name */ #include #include chk_ext(char *s, char *ext) { if(strchr(s, '.') == NULL) { strcat(s, "."); strcat(s, ext); } } .