libobs/util: Use MAX_PATH for absolute path funcs

Makes these functions a bit more consistent with the rest of the
project.
This commit is contained in:
jp9000
2020-02-26 18:44:58 -08:00
parent 3e3521b9e1
commit 46c8ef615d

View File

@@ -339,28 +339,28 @@ bool os_file_exists(const char *path)
size_t os_get_abs_path(const char *path, char *abspath, size_t size)
{
wchar_t wpath[512];
wchar_t wabspath[512];
wchar_t wpath[MAX_PATH];
wchar_t wabspath[MAX_PATH];
size_t out_len = 0;
size_t len;
if (!abspath)
return 0;
len = os_utf8_to_wcs(path, 0, wpath, 512);
len = os_utf8_to_wcs(path, 0, wpath, MAX_PATH);
if (!len)
return 0;
if (_wfullpath(wabspath, wpath, 512) != NULL)
if (_wfullpath(wabspath, wpath, MAX_PATH) != NULL)
out_len = os_wcs_to_utf8(wabspath, 0, abspath, size);
return out_len;
}
char *os_get_abs_path_ptr(const char *path)
{
char *ptr = bmalloc(512);
char *ptr = bmalloc(MAX_PATH);
if (!os_get_abs_path(path, ptr, 512)) {
if (!os_get_abs_path(path, ptr, MAX_PATH)) {
bfree(ptr);
ptr = NULL;
}