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

packet: Fix fallthrough compiler warnings

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2017-08-25 10:05:18 +02:00
parent a9846ccc0d
commit 2493e962fe
2 changed files with 9 additions and 1 deletions

View File

@@ -383,6 +383,14 @@ int ssh_connector_remove_event(ssh_connector connector);
# endif # endif
#endif #endif
#ifndef FALL_THROUGH
# ifdef HAVE_FALLTHROUGH_ATTRIBUTE
# define FALL_THROUGH __attribute__ ((fallthrough))
# else /* HAVE_FALLTHROUGH_ATTRIBUTE */
# define FALL_THROUGH
# endif /* HAVE_FALLTHROUGH_ATTRIBUTE */
#endif /* FALL_THROUGH */
void ssh_agent_state_free(void *data); void ssh_agent_state_free(void *data);
#endif /* _LIBSSH_PRIV_H */ #endif /* _LIBSSH_PRIV_H */

View File

@@ -220,7 +220,7 @@ int ssh_packet_socket_callback(const void *data, size_t receivedlen, void *user)
/* Saves the status of the current operations */ /* Saves the status of the current operations */
session->in_packet.len = len; session->in_packet.len = len;
session->packet_state = PACKET_STATE_SIZEREAD; session->packet_state = PACKET_STATE_SIZEREAD;
/* FALL TROUGH */ FALL_THROUGH;
case PACKET_STATE_SIZEREAD: case PACKET_STATE_SIZEREAD:
len = session->in_packet.len; len = session->in_packet.len;
to_be_read = len - blocksize + sizeof(uint32_t) + current_macsize; to_be_read = len - blocksize + sizeof(uint32_t) + current_macsize;