From dd4dd5e1e88cbc2476b9a952b89bff0a472ea03b Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Tue, 26 Feb 2008 21:28:51 +0000 Subject: [PATCH] Avoided to read content of non-regular files --- test/compare_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/compare_file.c b/test/compare_file.c index cd7cdbcd..8a450ba9 100644 --- a/test/compare_file.c +++ b/test/compare_file.c @@ -171,7 +171,7 @@ int Compare_2_files(char *adr1, char *adr2, char *adrc, int flag) differs= 1; } } - if(S_ISREG(s1.st_mode)) { + if(S_ISREG(s1.st_mode) && S_ISREG(s2.st_mode)) { fd1= open(adr1, O_RDONLY); if(fd1==-1) { printf("- %s : cannot open() : %s\n", adr1, strerror(errno));