1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-21 14:00:51 +03:00

misc.c: _libssh2_ntohu32 cast bit shifting (#401)

To quite overly aggressive analyzers. 

Note, the builds pass, Travis is having some issues with Docker images.
This commit is contained in:
Will Cosgrove
2019-08-29 12:12:21 -07:00
committed by GitHub
parent 43f24eb152
commit e5732992b1

View File

@@ -191,7 +191,10 @@ _libssh2_send(libssh2_socket_t sock, const void *buffer, size_t length,
unsigned int unsigned int
_libssh2_ntohu32(const unsigned char *buf) _libssh2_ntohu32(const unsigned char *buf)
{ {
return (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]; return (((unsigned int)buf[0] << 24)
| ((unsigned int)buf[1] << 16)
| ((unsigned int)buf[2] << 8)
| ((unsigned int)buf[3]));
} }