1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-29 01:03:57 +03:00

buffer: Reformat ssh_buffer_add_data()

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
Andreas Schneider
2020-06-03 10:10:11 +02:00
parent 2782cb0495
commit 10b3ebbe61

View File

@@ -310,8 +310,9 @@ int ssh_buffer_add_data(struct ssh_buffer_struct *buffer, const void *data, uint
}
if (buffer->allocated < (buffer->used + len)) {
if(buffer->pos > 0)
if (buffer->pos > 0) {
buffer_shift(buffer);
}
if (realloc_buffer(buffer, buffer->used + len) < 0) {
return -1;
}