Browse Source

example4: Fix unused-result warning for fgets()

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
pull/7/head
Andrew Jeffery 3 years ago
parent
commit
4ef0a3f874
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      example4.c

+ 4
- 1
example4.c View File

@ -42,7 +42,10 @@ void load_data() {
double *c = class + i * 3;
c[0] = c[1] = c[2] = 0.0;
fgets(line, 1024, in);
if (fgets(line, 1024, in) == NULL) {
perror("fgets");
exit(1);
}
char *split = strtok(line, ",");
for (j = 0; j < 4; ++j) {


Loading…
Cancel
Save