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