From f6709b03e63d89e95c677e9e55dc439b05db2554 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Thu, 24 Apr 2025 15:14:57 +0200 Subject: [PATCH] misc: Reformat Signed-off-by: Jakub Jelen Reviewed-by: Andreas Schneider --- src/misc.c | 72 +++++++++++++++++++++++++++--------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/src/misc.c b/src/misc.c index b1ebc0c4..ebf19bd5 100644 --- a/src/misc.c +++ b/src/misc.c @@ -430,22 +430,22 @@ int ssh_is_ipaddr(const char *str) char *ssh_lowercase(const char* str) { - char *new, *p; + char *new, *p; - if (str == NULL) { - return NULL; - } + if (str == NULL) { + return NULL; + } - new = strdup(str); - if (new == NULL) { - return NULL; - } + new = strdup(str); + if (new == NULL) { + return NULL; + } - for (p = new; *p; p++) { - *p = tolower(*p); - } + for (p = new; *p; p++) { + *p = tolower(*p); + } - return new; + return new; } char *ssh_hostport(const char *host, int port) @@ -865,32 +865,32 @@ int ssh_list_prepend(struct ssh_list *list, const void *data) void ssh_list_remove(struct ssh_list *list, struct ssh_iterator *iterator) { - struct ssh_iterator *ptr, *prev; + struct ssh_iterator *ptr, *prev; - if (list == NULL) { - return; - } + if (list == NULL) { + return; + } - prev=NULL; - ptr=list->root; - while(ptr && ptr != iterator){ - prev=ptr; - ptr=ptr->next; - } - if(!ptr){ - /* we did not find the element */ - return; - } - /* unlink it */ - if(prev) - prev->next=ptr->next; - /* if iterator was the head */ - if(list->root == iterator) - list->root=iterator->next; - /* if iterator was the tail */ - if(list->end == iterator) - list->end = prev; - SAFE_FREE(iterator); + prev = NULL; + ptr = list->root; + while (ptr && ptr != iterator) { + prev = ptr; + ptr = ptr->next; + } + if (!ptr) { + /* we did not find the element */ + return; + } + /* unlink it */ + if (prev) + prev->next = ptr->next; + /* if iterator was the head */ + if (list->root == iterator) + list->root = iterator->next; + /* if iterator was the tail */ + if (list->end == iterator) + list->end = prev; + SAFE_FREE(iterator); } /**