diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2013-08-04 07:53:29 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2013-08-04 07:53:29 +0000 |
commit | f59b4a57d87fdaf4a7b0c0e2202b7f67c86a1dc5 (patch) | |
tree | 27d4e84a59b79c2f09db0980fdd8ff401a496a87 | |
parent | Merge branch 'bug/execdict' (diff) | |
parent | Check length for Strchop() (diff) | |
download | w3m-f59b4a57d87fdaf4a7b0c0e2202b7f67c86a1dc5.tar.gz w3m-f59b4a57d87fdaf4a7b0c0e2202b7f67c86a1dc5.zip |
Merge branch 'bug/strchop'
Diffstat (limited to '')
-rw-r--r-- | Str.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -278,8 +278,8 @@ void Strchop(Str s) { STR_LENGTH_CHECK(s); - while ((s->ptr[s->length - 1] == '\n' || s->ptr[s->length - 1] == '\r') && - s->length > 0) { + while (s->length > 0 && + (s->ptr[s->length - 1] == '\n' || s->ptr[s->length - 1] == '\r')) { s->length--; } s->ptr[s->length] = '\0'; |