Add dst_size parameter to character conv funcs

Character conversion functions did not previously ask for a maximum
buffer size for their 'dst' parameter, it's unsafe to assume some given
destination buffer may have enough size to accommodate a conversion.
This commit is contained in:
jp9000
2014-05-22 03:42:43 -07:00
parent 6578e2952b
commit d536df30b0
5 changed files with 81 additions and 35 deletions

View File

@@ -78,6 +78,6 @@ string GetDefaultVideoSavePath()
SHGetFolderPathW(NULL, CSIDL_MYVIDEO, NULL, SHGFP_TYPE_CURRENT,
path_utf16);
os_wcs_to_utf8(path_utf16, wcslen(path_utf16), path_utf8);
os_wcs_to_utf8(path_utf16, wcslen(path_utf16), path_utf8, MAX_PATH);
return string(path_utf8);
}