diff options
author | Matt Johnston <matt@ucc.asn.au> | 2017-05-13 23:43:09 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2017-05-13 23:43:09 +0800 |
commit | 01bde8ff943baaf377cd16748f33e06b512aa22a (patch) | |
tree | 8d4b9339a42b667a9b159702731eacc2dee8c1ca /buffer.c | |
parent | eed0e2e431126e06730975ba63cf541068d20f47 (diff) |
reduce buf->pos if shrinking
Diffstat (limited to 'buffer.c')
-rw-r--r-- | buffer.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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 */ |