Update utils.c

Add compatibility for Windows style text files with #13 #10 end of line (\r\n)
This commit is contained in:
Dmitrivm 2017-11-17 12:43:02 +03:00 committed by GitHub
parent 16686cec57
commit b73837a435
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -356,6 +356,7 @@ char *fgetl(FILE *fp)
curr = strlen(line);
}
if(line[curr-1] == '\n') line[curr-1] = '\0';
if(line[curr-1] == '\r') line[curr-1] = '\0';
return line;
}