|
|
|
@ -171,9 +171,9 @@ int read_file(char *filename, point_t **points, unsigned int *n) {
|
|
|
|
|
float coord; |
|
|
|
|
int i; |
|
|
|
|
int j = 0; |
|
|
|
|
struct stat statbuff; |
|
|
|
|
struct stat statbuff; |
|
|
|
|
|
|
|
|
|
lstat(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; |
|
|
|
@ -183,11 +183,11 @@ int read_file(char *filename, point_t **points, unsigned int *n) {
|
|
|
|
|
return 2; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
file = fopen(filename, "r"); |
|
|
|
|
if (file == NULL) { |
|
|
|
|
perror("fopen"); |
|
|
|
|
return 4; |
|
|
|
|
} |
|
|
|
|
file = fopen(filename, "r"); |
|
|
|
|
if (file == NULL) { |
|
|
|
|
perror("fopen"); |
|
|
|
|
return 4; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
while ((chars = getline(&buffer, &size, file)) != -1) { |
|
|
|
|
if (*n == 0) { |
|
|
|
|