Commit d3c7df33 authored by not-a-robot's avatar not-a-robot
Browse files

Auto merge of #406 - DongwenHuang:patch-1, r=badboy

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'.
parents be2c4272 6bfc580a
...@@ -127,7 +127,7 @@ static char *seekNewline(char *s, size_t len) { ...@@ -127,7 +127,7 @@ static char *seekNewline(char *s, size_t len) {
* might not have a trailing NULL character. */ * might not have a trailing NULL character. */
while (pos < _len) { while (pos < _len) {
while(pos < _len && s[pos] != '\r') pos++; while(pos < _len && s[pos] != '\r') pos++;
if (s[pos] != '\r') { if (pos==_len) {
/* Not found. */ /* Not found. */
return NULL; return NULL;
} else { } else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment