mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
Update utils.c
Add compatibility for Windows style text files with #13 #10 end of line (\r\n)
This commit is contained in:
parent
16686cec57
commit
b73837a435
@ -356,6 +356,7 @@ char *fgetl(FILE *fp)
|
|||||||
curr = strlen(line);
|
curr = strlen(line);
|
||||||
}
|
}
|
||||||
if(line[curr-1] == '\n') line[curr-1] = '\0';
|
if(line[curr-1] == '\n') line[curr-1] = '\0';
|
||||||
|
if(line[curr-1] == '\r') line[curr-1] = '\0';
|
||||||
|
|
||||||
return line;
|
return line;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user