What's wrong with my functions ? I need to check if the files found are dirs! but when a use strcat() for sum de localdir and the name.... puff !! segment fault !!! thanks
Code:void scan (char *localDir) { struct dirent **namelist; int n; n = scandir(localDir, &namelist, 0, alphasort); if (n < 0) perror("scandir"); else { while(n--) { char *filename = strcat(localDir, namelist[n]->d_name); if (isDir(filename) { printf("%s \n", filename); } free(namelist[n]); } free(namelist); } }