Przeglądaj źródła

libobs/util: Use MAX_PATH for absolute path funcs

Makes these functions a bit more consistent with the rest of the
project.
jp9000 5 lat temu
rodzic
commit
46c8ef615d
1 zmienionych plików z 6 dodań i 6 usunięć
  1. 6 6
      libobs/util/platform-windows.c

+ 6 - 6
libobs/util/platform-windows.c

@@ -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;
 	}