diff options
author | not-a-robot <not-a-robot@rediger.net> | 2016-04-20 17:24:30 +0200 |
---|---|---|
committer | not-a-robot <not-a-robot@rediger.net> | 2016-04-20 17:24:30 +0200 |
commit | d3c7df33a1e278c6f0ae86506e0cbe5de35e36e3 (patch) | |
tree | 5058f9d62a576bdfae7f72d8efff08bd7baef2fa | |
parent | be2c4272c434c21149f8603a6f61e5e348539ebe (diff) | |
parent | 6bfc580a3478e5b1e4534748ada6eac6514d8b55 (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.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 { |