From 6bfc580a3478e5b1e4534748ada6eac6514d8b55 Mon Sep 17 00:00:00 2001 From: DongwenHuang Date: Mon, 11 Apr 2016 23:27:45 +0800 Subject: 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'. --- read.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'read.c') diff --git a/read.c b/read.c index df1a467..50333b5 100644 --- a/read.c +++ b/read.c @@ -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 { -- cgit v1.2.3