1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-20 02:42:09 +03:00

Fix errors identified by the build process

This commit is contained in:
Michael Buckley
2019-03-18 16:37:03 -07:00
parent b242bde524
commit 09cc9aba28
2 changed files with 3 additions and 3 deletions

View File

@@ -746,11 +746,11 @@ int _libssh2_get_u32(struct string_buf *buf, uint32_t *out)
int _libssh2_get_u64(struct string_buf *buf, libssh2_uint64_t *out) int _libssh2_get_u64(struct string_buf *buf, libssh2_uint64_t *out)
{ {
unsigned char *p = buf->dataptr;
if (!_libssh2_check_length(buf, 8)) { if (!_libssh2_check_length(buf, 8)) {
return -1; return -1;
} }
unsigned char *p = buf->dataptr;
*out = _libssh2_ntohu64(p); *out = _libssh2_ntohu64(p);
buf->dataptr += 8; buf->dataptr += 8;
buf->offset += 8; buf->offset += 8;

View File

@@ -482,7 +482,7 @@ int _libssh2_transport_read(LIBSSH2_SESSION * session)
/* copy the data from index 5 to the end of /* copy the data from index 5 to the end of
the blocksize from the temporary buffer to the blocksize from the temporary buffer to
the start of the decrypted buffer */ the start of the decrypted buffer */
if (blocksize - 5 <= total_num) { if (blocksize - 5 <= (int) total_num) {
memcpy(p->wptr, &block[5], blocksize - 5); memcpy(p->wptr, &block[5], blocksize - 5);
p->wptr += blocksize - 5; /* advance write pointer */ p->wptr += blocksize - 5; /* advance write pointer */
} else { } else {
@@ -564,7 +564,7 @@ int _libssh2_transport_read(LIBSSH2_SESSION * session)
copy them as-is to the target buffer */ copy them as-is to the target buffer */
if(numbytes > 0) { if(numbytes > 0) {
if (numbytes <= total_num - (p->wptr - p->payload)) { if (numbytes <= (int)(total_num - (p->wptr - p->payload))) {
memcpy(p->wptr, &p->buf[p->readidx], numbytes); memcpy(p->wptr, &p->buf[p->readidx], numbytes);
} }
else { else {