diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2018-09-02 14:03:29 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-09-04 12:29:09 +0200 |
commit | d1f23cd6d856b4e985e31e636f5702a4775d3516 (patch) | |
tree | 4c65fbf21f6c7fa6f7ccc3acf75ee445f525e50c /src/string.c | |
parent | e601dbd8e3f09eb24becca06eca5798aaee3f1df (diff) | |
download | libssh-d1f23cd6d856b4e985e31e636f5702a4775d3516.tar.gz libssh-d1f23cd6d856b4e985e31e636f5702a4775d3516.tar.xz libssh-d1f23cd6d856b4e985e31e636f5702a4775d3516.zip |
string: Reformat ssh_string_new()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Diffstat (limited to 'src/string.c')
-rw-r--r-- | src/string.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/string.c b/src/string.c index 42ba2d92..8e6dfc4c 100644 --- a/src/string.c +++ b/src/string.c @@ -50,22 +50,23 @@ * * @return The newly allocated string, NULL on error. */ -struct ssh_string_struct *ssh_string_new(size_t size) { - struct ssh_string_struct *str = NULL; +struct ssh_string_struct *ssh_string_new(size_t size) +{ + struct ssh_string_struct *str = NULL; - if (size > UINT_MAX - sizeof(struct ssh_string_struct)) { - return NULL; - } + if (size > UINT_MAX - sizeof(struct ssh_string_struct)) { + return NULL; + } - str = malloc(sizeof(struct ssh_string_struct) + size); - if (str == NULL) { - return NULL; - } + str = malloc(sizeof(struct ssh_string_struct) + size); + if (str == NULL) { + return NULL; + } - str->size = htonl(size); - str->data[0] = 0; + str->size = htonl(size); + str->data[0] = 0; - return str; + return str; } /** |