win32.c
changeset 5120 e12dfc67761f
parent 5108 dc67d70b5a45
child 5167 2b9d61386688
--- a/win32.c	Fri Nov 17 23:29:22 2006 +0000
+++ b/win32.c	Sat Nov 18 00:14:43 2006 +0000
@@ -637,7 +637,6 @@
 
 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 @@
 	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 @@
 	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);