From a7cf4bb37b87583c9429a73740e503c5a4357256 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Tue, 27 Jan 2026 15:43:44 +0100 Subject: [PATCH] misc: Reformat ssh_get_user_home_dir() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub Jelen Reviewed-by: Pavol Žáčik Reviewed-by: Andreas Schneider --- src/misc.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/misc.c b/src/misc.c index 674b05d2..1432469f 100644 --- a/src/misc.c +++ b/src/misc.c @@ -110,20 +110,20 @@ #ifdef _WIN32 char *ssh_get_user_home_dir(void) { - char tmp[PATH_MAX] = {0}; - char *szPath = NULL; + char tmp[PATH_MAX] = {0}; + char *szPath = NULL; - if (SHGetSpecialFolderPathA(NULL, tmp, CSIDL_PROFILE, TRUE)) { - szPath = malloc(strlen(tmp) + 1); - if (szPath == NULL) { - return NULL; + if (SHGetSpecialFolderPathA(NULL, tmp, CSIDL_PROFILE, TRUE)) { + szPath = malloc(strlen(tmp) + 1); + if (szPath == NULL) { + return NULL; + } + + strcpy(szPath, tmp); + return szPath; } - strcpy(szPath, tmp); - return szPath; - } - - return NULL; + return NULL; } /* we have read access on file */