From 38f31bb21f1897e9b960466e96d83b3b0e92e3f0 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Sat, 8 Dec 2018 15:53:58 -0300 Subject: [PATCH] add check for symlinks --- src/read_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/read_file.c b/src/read_file.c index 102edea..d08cd44 100644 --- a/src/read_file.c +++ b/src/read_file.c @@ -173,7 +173,7 @@ int read_file(char *filename, point_t **points, unsigned int *n) { int j = 0; struct stat statbuff; - stat(filename, &statbuff); + lstat(filename, &statbuff); if (access(filename, F_OK) || !S_ISREG(statbuff.st_mode)) { fprintf(stderr, "Error: El archivo \"%s\" no existe!\n", filename); return 1;