From 3ecff2c0ebb6705b5aba0cfaf29a63bb049a794a Mon Sep 17 00:00:00 2001 From: Phil Dawes Date: Fri, 4 Sep 2009 19:52:05 +0100 Subject: [PATCH] fixed bug where vm_char being treated as 1byte type --- vm/os-windows.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vm/os-windows.cpp b/vm/os-windows.cpp index 38c8b944a4..bd7e573dcc 100644 --- a/vm/os-windows.cpp +++ b/vm/os-windows.cpp @@ -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); } -- 2.34.1