]> gitweb.factorcode.org Git - factor.git/commitdiff
fixed bug where vm_char being treated as 1byte type
authorPhil Dawes <phil@phildawes.net>
Fri, 4 Sep 2009 18:52:05 +0000 (19:52 +0100)
committerPhil Dawes <phil@phildawes.net>
Wed, 16 Sep 2009 07:22:17 +0000 (08:22 +0100)
vm/os-windows.cpp

index 38c8b944a4750b01ca68ed3e757a7a206c0cec4b..bd7e573dccb18a19c73e5febdf62acaec320b280 100644 (file)
@@ -60,7 +60,7 @@ bool factorvm::windows_stat(vm_char *path)
 void factorvm::windows_image_path(vm_char *full_path, vm_char *temp_path, unsigned int length)
 {
        snwprintf(temp_path, length-1, L"%s.image", full_path); 
-       temp_path[sizeof(temp_path) - 1] = 0;
+       temp_path[length - 1] = 0;
 }
 
 /* You must free() this yourself. */
@@ -76,8 +76,8 @@ const vm_char *factorvm::default_image_path()
        if((ptr = wcsrchr(full_path, '.')))
                *ptr = 0;
 
-       snwprintf(temp_path, sizeof(temp_path)-1, L"%s.image", full_path); 
-       temp_path[sizeof(temp_path) - 1] = 0;
+       snwprintf(temp_path, MAX_UNICODE_PATH-1, L"%s.image", full_path); 
+       temp_path[MAX_UNICODE_PATH - 1] = 0;
 
        return safe_strdup(temp_path);
 }