check for minimum of 2 points

This commit is contained in:
Chris Cromer 2018-12-08 23:27:50 -03:00
parent c24a2a2fee
commit 0edcd7f4a8
Signed by: cromer
GPG Key ID: 39CC813FF3C8708A
1 changed files with 1 additions and 1 deletions

View File

@ -250,7 +250,7 @@ int read_file(char *filename, point_t **points, unsigned int *n) {
buffer = NULL;
size = 0;
}
if (j < *n) {
if (j < *n || *n < 2) {
fprintf(stderr, "Error: No hay suficiente puntos!\n");
return 9;
}