mirror of
https://github.com/libssh2/libssh2.git
synced 2025-11-20 02:42:09 +03:00
Use string_buf in sftp_init().
This commit is contained in:
13
src/misc.c
13
src/misc.c
@@ -744,6 +744,19 @@ int _libssh2_get_u32(struct string_buf *buf, uint32_t *out)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int _libssh2_get_u64(struct string_buf *buf, uint64_t *out)
|
||||
{
|
||||
if (!_libssh2_check_length(buf, 8)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
unsigned char *p = buf->dataptr;
|
||||
*out = _libssh2_ntohu64(p);
|
||||
buf->dataptr += 8;
|
||||
buf->offset -= 8;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int _libssh2_match_string(struct string_buf *buf, const char *match)
|
||||
{
|
||||
unsigned char *out;
|
||||
|
||||
Reference in New Issue
Block a user