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:
@@ -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->allocated < (buffer->used + len)) {
|
||||||
if(buffer->pos > 0)
|
if (buffer->pos > 0) {
|
||||||
buffer_shift(buffer);
|
buffer_shift(buffer);
|
||||||
|
}
|
||||||
if (realloc_buffer(buffer, buffer->used + len) < 0) {
|
if (realloc_buffer(buffer, buffer->used + len) < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user