Convert \r to \n while reading the file
This commit is contained in:
parent
6aaec038f8
commit
da7d172d37
1 changed files with 4 additions and 0 deletions
|
@ -68,6 +68,10 @@ int reads(int fd, char *buf, unsigned int len) {
|
||||||
&& ((c != '\n') && (c != '\r'));
|
&& ((c != '\n') && (c != '\r'));
|
||||||
i++)
|
i++)
|
||||||
buf[i] = c;
|
buf[i] = c;
|
||||||
|
|
||||||
|
if (buf[i] == '\r')
|
||||||
|
buf[i] = '\n';
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue