diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2021-03-04 14:46:21 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2021-03-04 14:46:21 +0000 |
commit | 13015ebcf62aeeeddc298710c7cd889281f49844 (patch) | |
tree | 9f57b956de7323137e3942da7840e0ec4d8d7e5b | |
parent | Update ChangeLog (diff) | |
download | w3m-13015ebcf62aeeeddc298710c7cd889281f49844.tar.gz w3m-13015ebcf62aeeeddc298710c7cd889281f49844.zip |
Prevent unneeded Strgrow in Strinsert_char
-rw-r--r-- | Str.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -348,7 +348,7 @@ Strinsert_char(Str s, int pos, char c) { int i; STR_LENGTH_CHECK(s); - if (pos < 0) + if (pos < 0 || s->length < pos) return; if (s->length + 2 > s->area_size) Strgrow(s); |