diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2015-02-02 16:59:48 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2015-02-02 17:32:31 +0100 |
commit | de10a7754b7cfe4f5956ff575113211f222f960b (patch) | |
tree | 92556758dcc7a73b5d8fb387589e6c74c4582a6a /include | |
parent | 6789170799e6f6bf7bad96b4341017b7a931fa88 (diff) | |
download | libssh-de10a7754b7cfe4f5956ff575113211f222f960b.tar.gz libssh-de10a7754b7cfe4f5956ff575113211f222f960b.tar.xz libssh-de10a7754b7cfe4f5956ff575113211f222f960b.zip |
buffer: buffer: Improve argument checking of in ssh_buffer_pack()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be>
Diffstat (limited to 'include')
-rw-r--r-- | include/libssh/buffer.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/include/libssh/buffer.h b/include/libssh/buffer.h index 1cc8196c..826d0b7c 100644 --- a/include/libssh/buffer.h +++ b/include/libssh/buffer.h @@ -64,9 +64,15 @@ int _ssh_buffer_pack(struct ssh_buffer_struct *buffer, #define ssh_buffer_pack(buffer, format, ...) \ _ssh_buffer_pack((buffer), (format), __VA_NARG__(__VA_ARGS__), __VA_ARGS__, SSH_BUFFER_PACK_END) -int ssh_buffer_unpack_va(struct ssh_buffer_struct *buffer, const char *format, va_list ap); -int _ssh_buffer_unpack(struct ssh_buffer_struct *buffer, const char *format, ...); -#define ssh_buffer_unpack(buffer, format, ...) _ssh_buffer_unpack((buffer),(format), __VA_ARGS__, SSH_BUFFER_PACK_END) +int ssh_buffer_unpack_va(struct ssh_buffer_struct *buffer, + const char *format, int argc, + va_list ap); +int _ssh_buffer_unpack(struct ssh_buffer_struct *buffer, + const char *format, + int argc, + ...); +#define ssh_buffer_unpack(buffer, format, ...) \ + _ssh_buffer_unpack((buffer), (format), __VA_NARG__(__VA_ARGS__), __VA_ARGS__, SSH_BUFFER_PACK_END) int buffer_prepend_data(ssh_buffer buffer, const void *data, uint32_t len); int buffer_add_buffer(ssh_buffer buffer, ssh_buffer source); |