diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2018-09-03 18:04:15 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-09-04 19:58:38 +0200 |
commit | 78498ee289f7001f0365ea11895214d36427d3d3 (patch) | |
tree | a4ac1b8cc7ba41f4111bd3f5040316f1d1f24bf1 /src/packet.c | |
parent | 76f5a60a82a8349e7febf6e593c404fac10f6bba (diff) | |
download | libssh-78498ee289f7001f0365ea11895214d36427d3d3.tar.gz libssh-78498ee289f7001f0365ea11895214d36427d3d3.tar.xz libssh-78498ee289f7001f0365ea11895214d36427d3d3.zip |
packet: Use C99 initializer to reset session->in_packet
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Diffstat (limited to 'src/packet.c')
-rw-r--r-- | src/packet.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/packet.c b/src/packet.c index ae258381..aa2f17f0 100644 --- a/src/packet.c +++ b/src/packet.c @@ -199,7 +199,9 @@ int ssh_packet_socket_callback(const void *data, size_t receivedlen, void *user) return 0; } - memset(&session->in_packet, 0, sizeof(PACKET)); + session->in_packet = (struct packet_struct) { + .type = 0, + }; if (session->in_buffer) { rc = ssh_buffer_reinit(session->in_buffer); @@ -515,9 +517,11 @@ SSH_PACKET_CALLBACK(ssh_packet_unimplemented){ /** @internal * @parse the "Type" header field of a packet and updates the session */ -int ssh_packet_parse_type(ssh_session session) +int ssh_packet_parse_type(struct ssh_session_struct *session) { - memset(&session->in_packet, 0, sizeof(PACKET)); + session->in_packet = (struct packet_struct) { + .type = 0, + }; if (session->in_buffer == NULL) { return SSH_ERROR; |