1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-08-08 19:02:06 +03:00

buffer: do not use ssh_buffer_get_rest_len()

As ssh_buffer_get_len() actually calls ssh_buffer_get_rest_len(), let's
just use the first one. This is a preparatory step for removing
ssh_buffer_get_rest_len().

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Fabiano Fidêncio
2015-09-25 00:34:42 +02:00
parent 25707e9752
commit 05fd0acf45
19 changed files with 94 additions and 94 deletions

View File

@@ -144,7 +144,7 @@ static int ssh_pcap_file_write(ssh_pcap_file pcap, ssh_buffer packet){
uint32_t len;
if(pcap == NULL || pcap->output==NULL)
return SSH_ERROR;
len=ssh_buffer_get_rest_len(packet);
len=ssh_buffer_get_len(packet);
err=fwrite(ssh_buffer_get(packet),len,1,pcap->output);
if(err<0)
return SSH_ERROR;
@@ -171,7 +171,7 @@ int ssh_pcap_file_write_packet(ssh_pcap_file pcap, ssh_buffer packet, uint32_t o
if (err < 0) {
goto error;
}
err = ssh_buffer_add_u32(header,htonl(ssh_buffer_get_rest_len(packet)));
err = ssh_buffer_add_u32(header,htonl(ssh_buffer_get_len(packet)));
if (err < 0) {
goto error;
}