mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 02:38:09 +09:00
misc: Reformat ssh_get_user_home_dir()
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Pavol Žáčik <pzacik@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
22
src/misc.c
22
src/misc.c
@@ -110,20 +110,20 @@
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
char *ssh_get_user_home_dir(void)
|
char *ssh_get_user_home_dir(void)
|
||||||
{
|
{
|
||||||
char tmp[PATH_MAX] = {0};
|
char tmp[PATH_MAX] = {0};
|
||||||
char *szPath = NULL;
|
char *szPath = NULL;
|
||||||
|
|
||||||
if (SHGetSpecialFolderPathA(NULL, tmp, CSIDL_PROFILE, TRUE)) {
|
if (SHGetSpecialFolderPathA(NULL, tmp, CSIDL_PROFILE, TRUE)) {
|
||||||
szPath = malloc(strlen(tmp) + 1);
|
szPath = malloc(strlen(tmp) + 1);
|
||||||
if (szPath == NULL) {
|
if (szPath == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
strcpy(szPath, tmp);
|
||||||
|
return szPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(szPath, tmp);
|
return NULL;
|
||||||
return szPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* we have read access on file */
|
/* we have read access on file */
|
||||||
|
|||||||
Reference in New Issue
Block a user