aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolden Rohrer <hr@hrhr.dev>2020-03-30 23:52:18 -0400
committerHolden Rohrer <hr@hrhr.dev>2020-03-30 23:52:18 -0400
commit7b09cacea5008106a3f0964d47fdf54bf4ff5a58 (patch)
tree53dd66cf695a4a5c721c79e83fdc5f27c51b88df
parent500d4ee1346a6a783e7a52f2fc703b742aa53079 (diff)
peekstrbuf didn't cycle through nodes (bug)
-rw-r--r--buf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/buf.c b/buf.c
index 65bc7a7..a219773 100644
--- a/buf.c
+++ b/buf.c
@@ -105,6 +105,7 @@ char* peekstrbuf(buf* buffer, size_t loc, size_t len){
for (size_t tgt = 0; len > 0; len -= bytect, tgt += bytect){
bytect = min(buffer->cap - loc, len);
memcpy(str+tgt, start->text+loc, bytect);
+ start = start->next;
loc = 0;
}
return str;