summaryrefslogtreecommitdiffhomepage
path: root/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/buffer.c b/buffer.c
index d646c0e..0ca50b4 100644
--- a/buffer.c
+++ b/buffer.c
@@ -109,6 +109,7 @@ void buf_setlen(buffer* buf, unsigned int len) {
dropbear_exit("Bad buf_setlen");
}
buf->len = len;
+ buf->pos = MIN(buf->pos, buf->len);
}
/* Increment the length of the buffer */