(svn r3056) - Fix: Problem on Win98 and lower when if you go to the root directory of a drive (eg. C:\) you were stuck there indefinitely and couldn't change any directories or see any files
authorDarkvater
Mon, 17 Oct 2005 22:24:32 +0000
changeset 2527 c205f6a03fb5
parent 2526 29eef390cabb
child 2528 9317f58bf73c
(svn r3056) - Fix: Problem on Win98 and lower when if you go to the root directory of a drive (eg. C:\) you were stuck there indefinitely and couldn't change any directories or see any files
win32.c
--- a/win32.c	Mon Oct 17 19:57:00 2005 +0000
+++ b/win32.c	Mon Oct 17 22:24:32 2005 +0000
@@ -631,7 +631,7 @@
 	HANDLE h;
 	char paths[MAX_PATH];
 
-	sprintf(paths, "%s\\%s", path, file);
+	snprintf(paths, sizeof(paths), "%s\\%s", path, file);
 	h = FindFirstFile(paths, fd);
 
 	SetErrorMode(sem); // restore previous setting
@@ -900,7 +900,7 @@
 
 	switch (item->type) {
 		case FIOS_TYPE_DRIVE:
-			sprintf(path, "%c:\\", item->title[0]);
+			sprintf(path, "%c:", item->title[0]);
 			break;
 
 		case FIOS_TYPE_PARENT: