fixed bug where vm_char being treated as 1byte type

db4
Phil Dawes 2009-09-04 19:52:05 +01:00
parent 34ce334317
commit 3ecff2c0eb
1 changed files with 3 additions and 3 deletions

View 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) 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); 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. */ /* You must free() this yourself. */
@ -76,8 +76,8 @@ const vm_char *factorvm::default_image_path()
if((ptr = wcsrchr(full_path, '.'))) if((ptr = wcsrchr(full_path, '.')))
*ptr = 0; *ptr = 0;
snwprintf(temp_path, sizeof(temp_path)-1, L"%s.image", full_path); snwprintf(temp_path, MAX_UNICODE_PATH-1, L"%s.image", full_path);
temp_path[sizeof(temp_path) - 1] = 0; temp_path[MAX_UNICODE_PATH - 1] = 0;
return safe_strdup(temp_path); return safe_strdup(temp_path);
} }