summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornot-a-robot <not-a-robot@rediger.net>2016-04-20 17:24:30 +0200
committernot-a-robot <not-a-robot@rediger.net>2016-04-20 17:24:30 +0200
commitd3c7df33a1e278c6f0ae86506e0cbe5de35e36e3 (patch)
tree5058f9d62a576bdfae7f72d8efff08bd7baef2fa
parentbe2c4272c434c21149f8603a6f61e5e348539ebe (diff)
parent6bfc580a3478e5b1e4534748ada6eac6514d8b55 (diff)
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'.
-rw-r--r--read.c2
1 files changed, 1 insertions, 1 deletions
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 {