From d5d8d819b803fa9984be5cea88b75417250bf7ce Mon Sep 17 00:00:00 2001 From: Carl Nettelblad Date: Sat, 3 Mar 2001 13:28:28 +0000 Subject: [PATCH] Reflecting changes in crtdll. svn path=/trunk/; revision=1659 --- reactos/lib/msvcrt/stdlib/makepath.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/reactos/lib/msvcrt/stdlib/makepath.c b/reactos/lib/msvcrt/stdlib/makepath.c index 3b577d899bb..f7f3322d3a6 100644 --- a/reactos/lib/msvcrt/stdlib/makepath.c +++ b/reactos/lib/msvcrt/stdlib/makepath.c @@ -5,16 +5,18 @@ void _makepath( char *path, const char *drive, const char *dir, const char *fnam { int dir_len; if ( drive != NULL ) { - strcat(path,drive); + strcpy(path,drive); strcat(path,":"); } + else + (*path)=0; if ( dir != NULL ) { strcat(path,dir); if ( *dir != '\\' ) strcat(path,"\\"); dir_len = strlen(dir); - if ( *(dir + dir_len - 1) != '\\' ) + if (dir_len && *(dir + dir_len - 1) != '\\' ) strcat(path,"\\"); } if ( fname != NULL ) { @@ -31,16 +33,18 @@ void _wmakepath( wchar_t *path, const wchar_t *drive, const wchar_t *dir, const { int dir_len; if ( drive != NULL ) { - wcscat(path,drive); + wcscpy(path,drive); wcscat(path,L":"); } + else + (*path)=0; if ( dir != NULL ) { wcscat(path,dir); if ( *dir != L'\\' ) wcscat(path,L"\\"); dir_len = wcslen(dir); - if ( *(dir + dir_len - 1) != L'\\' ) + if ( dir_len && *(dir + dir_len - 1) != L'\\' ) wcscat(path,L"\\"); } if ( fname != NULL ) {