summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2005-10-17 22:24:32 +0000
committerDarkvater <Darkvater@openttd.org>2005-10-17 22:24:32 +0000
commit3fb68358226994f11a7c329e0d032f28a88013e2 (patch)
tree280aac3e0f1e38cffaa2bcbf78e4ad5359fb58de
parentc042fd3de3c3e3a8ceec1386d1dcc7ae9fad4a90 (diff)
downloadopenttd-3fb68358226994f11a7c329e0d032f28a88013e2.tar.xz
(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
-rw-r--r--win32.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/win32.c b/win32.c
index 5188065ea..f1bc33da5 100644
--- a/win32.c
+++ b/win32.c
@@ -631,7 +631,7 @@ static HANDLE MyFindFirstFile(const char *path, const char *file, WIN32_FIND_DAT
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 @@ char *FiosBrowseTo(const FiosItem *item)
switch (item->type) {
case FIOS_TYPE_DRIVE:
- sprintf(path, "%c:\\", item->title[0]);
+ sprintf(path, "%c:", item->title[0]);
break;
case FIOS_TYPE_PARENT: