diff options
author | DongwenHuang <huangdongwen789@gmail.com> | 2016-04-11 23:27:45 +0800 |
---|---|---|
committer | DongwenHuang <huangdongwen789@gmail.com> | 2016-04-11 23:27:45 +0800 |
commit | 6bfc580a3478e5b1e4534748ada6eac6514d8b55 (patch) | |
tree | 8696ddb9abd5634db6329725c4c5ab1caa1e72b7 /read.c | |
parent | 1b8ed38843319e17c54021a3b2a9b496159ebdcb (diff) |
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'.
Diffstat (limited to 'read.c')
-rw-r--r-- | read.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 { |