mirror of
https://github.com/libssh2/libssh2.git
synced 2025-11-21 14:00:51 +03:00
Fix type and logic issues with _libssh2_get_u64
This commit is contained in:
@@ -744,7 +744,7 @@ int _libssh2_get_u32(struct string_buf *buf, uint32_t *out)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int _libssh2_get_u64(struct string_buf *buf, uint64_t *out)
|
int _libssh2_get_u64(struct string_buf *buf, libssh2_uint64_t *out)
|
||||||
{
|
{
|
||||||
if (!_libssh2_check_length(buf, 8)) {
|
if (!_libssh2_check_length(buf, 8)) {
|
||||||
return -1;
|
return -1;
|
||||||
@@ -753,7 +753,7 @@ int _libssh2_get_u64(struct string_buf *buf, uint64_t *out)
|
|||||||
unsigned char *p = buf->dataptr;
|
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;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ void _libssh2_explicit_zero(void *buf, size_t size);
|
|||||||
struct string_buf* _libssh2_string_buf_new(LIBSSH2_SESSION *session);
|
struct string_buf* _libssh2_string_buf_new(LIBSSH2_SESSION *session);
|
||||||
void _libssh2_string_buf_free(LIBSSH2_SESSION *session, struct string_buf *buf);
|
void _libssh2_string_buf_free(LIBSSH2_SESSION *session, struct string_buf *buf);
|
||||||
int _libssh2_get_u32(struct string_buf *buf, uint32_t *out);
|
int _libssh2_get_u32(struct string_buf *buf, uint32_t *out);
|
||||||
int _libssh2_get_u64(struct string_buf *buf, uint64_t *out);
|
int _libssh2_get_u64(struct string_buf *buf, libssh2_uint64_t *out);
|
||||||
int _libssh2_match_string(struct string_buf *buf, const char *match);
|
int _libssh2_match_string(struct string_buf *buf, const char *match);
|
||||||
int _libssh2_get_c_string(struct string_buf *buf, unsigned char **outbuf);
|
int _libssh2_get_c_string(struct string_buf *buf, unsigned char **outbuf);
|
||||||
int _libssh2_get_bignum_bytes(struct string_buf *buf, unsigned char **outbuf);
|
int _libssh2_get_bignum_bytes(struct string_buf *buf, unsigned char **outbuf);
|
||||||
|
|||||||
Reference in New Issue
Block a user