Avoided to read content of non-regular files
This commit is contained in:
parent
e51ace31b1
commit
dd4dd5e1e8
@ -171,7 +171,7 @@ int Compare_2_files(char *adr1, char *adr2, char *adrc, int flag)
|
|||||||
differs= 1;
|
differs= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(S_ISREG(s1.st_mode)) {
|
if(S_ISREG(s1.st_mode) && S_ISREG(s2.st_mode)) {
|
||||||
fd1= open(adr1, O_RDONLY);
|
fd1= open(adr1, O_RDONLY);
|
||||||
if(fd1==-1) {
|
if(fd1==-1) {
|
||||||
printf("- %s : cannot open() : %s\n", adr1, strerror(errno));
|
printf("- %s : cannot open() : %s\n", adr1, strerror(errno));
|
||||||
|
Loading…
Reference in New Issue
Block a user