From d1f23cd6d856b4e985e31e636f5702a4775d3516 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sun, 2 Sep 2018 14:03:29 +0200 Subject: [PATCH] string: Reformat ssh_string_new() Signed-off-by: Andreas Schneider Reviewed-by: Jakub Jelen --- src/string.c | 25 +++++++++++++------------ 1 file 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; } /**