diff --git a/programs/winecfg/drivedetect.c b/programs/winecfg/drivedetect.c index e24276c142f..4583e2f73c3 100644 --- a/programs/winecfg/drivedetect.c +++ b/programs/winecfg/drivedetect.c @@ -151,9 +151,12 @@ static void ensure_root_is_mapped() for (letter = 'Z'; letter >= 'A'; letter--) { - if (drives[letter - 'A'].in_use) continue; - add_drive(letter, "/", "System", 0, DRIVE_FIXED); - WINE_TRACE("allocated drive %c as the root drive\n", letter); + if (!drives[letter - 'A'].in_use) + { + add_drive(letter, "/", "System", "0", DRIVE_FIXED); + WINE_TRACE("allocated drive %c as the root drive\n", letter); + break; + } } if (letter == ('A' - 1)) report_error(NO_ROOT); diff --git a/programs/winecfg/winecfg.h b/programs/winecfg/winecfg.h index f54f5439e4b..b2ba0a9109a 100644 --- a/programs/winecfg/winecfg.h +++ b/programs/winecfg/winecfg.h @@ -108,7 +108,7 @@ void PRINTERROR(void); /* WINE_TRACE() the plaintext error message from GetLastE /* returns a string in the win32 heap */ static inline char *strdupA(char *s) { - char *r = HeapAlloc(GetProcessHeap(), 0, strlen(s)); + char *r = HeapAlloc(GetProcessHeap(), 0, strlen(s)+1); return strcpy(r, s); }