summaryrefslogtreecommitdiff
path: root/win32.c
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2006-11-18 00:14:43 +0000
committerDarkvater <Darkvater@openttd.org>2006-11-18 00:14:43 +0000
commit1a87a33911c26b69a1143709410a7837d84e24cd (patch)
tree75a3954c33043c724e452fafd6ef0b60291b6eb6 /win32.c
parent20cf41522e61a34b97f7f24487dd67231a929bef (diff)
downloadopenttd-1a87a33911c26b69a1143709410a7837d84e24cd.tar.xz
(svn r7200) -Codechange: remove unneeded redraw (console.c), coding style, use FindWindowById
instead of _windows loop (viewport.c), remove dump-code (mixer.c), MSVC6 borkdness in stdafx.h, constness (viewport.c), variable localization (win32.c), comments (window.c)
Diffstat (limited to 'win32.c')
-rw-r--r--win32.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/win32.c b/win32.c
index b8e34c4d5..4a14b65c9 100644
--- a/win32.c
+++ b/win32.c
@@ -637,7 +637,6 @@ static inline void dir_free(DIR *d)
DIR *opendir(const char *path)
{
- char search_path[MAX_PATH];
DIR *d;
UINT sem = SetErrorMode(SEM_FAILCRITICALERRORS); // disable 'no-disk' message box
DWORD fa = GetFileAttributes(path);
@@ -645,6 +644,7 @@ DIR *opendir(const char *path)
if ((fa != INVALID_FILE_ATTRIBUTES) && (fa & FILE_ATTRIBUTE_DIRECTORY)) {
d = dir_calloc();
if (d != NULL) {
+ char search_path[MAX_PATH];
/* build search path for FindFirstFile */
snprintf(search_path, lengthof(search_path), "%s" PATHSEP "*", path);
d->hFind = FindFirstFile(search_path, &d->fd);
@@ -893,7 +893,7 @@ void DeterminePaths(void)
GetCurrentDirectory(MAX_PATH - 1, cfg);
cfg[0] = toupper(cfg[0]);
- s = strchr(cfg, 0);
+ s = strchr(cfg, '\0');
if (s[-1] != '\\') strcpy(s, "\\");
_path.save_dir = str_fmt("%ssave", cfg);