Update read.c

static char *seekNewline(char *s, size_t len)  : 
this function can not parse the string,such as "hello world\r". the case that  the last char is '\r'.
This commit is contained in:
DongwenHuang 2016-04-11 23:27:45 +08:00
parent 1b8ed38843
commit 6bfc580a34
1 changed files with 1 additions and 1 deletions

2
read.c
View File

@ -127,7 +127,7 @@ static char *seekNewline(char *s, size_t len) {
* might not have a trailing NULL character. */
while (pos < _len) {
while(pos < _len && s[pos] != '\r') pos++;
if (s[pos] != '\r') {
if (pos==_len) {
/* Not found. */
return NULL;
} else {