Skip to content

Commit 5486cb4

Browse files
committed
Fix strcat warnings
1 parent 2e9d65d commit 5486cb4

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

src/webui.c

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3683,7 +3683,7 @@ void webui_interface_set_response_file_handler(size_t window, const void* respon
36833683
#ifdef WEBUI_LOG
36843684
printf("[User] webui_interface_set_response_file_handler()\n");
36853685
printf("[User] webui_interface_set_response_file_handler() -> window #%zu\n", window);
3686-
printf("[User] webui_interface_set_response_file_handler() -> Response %zu bytes\n", length);
3686+
printf("[User] webui_interface_set_response_file_handler() -> Response %d bytes\n", length);
36873687
#endif
36883688

36893689
// Initialization
@@ -5227,10 +5227,24 @@ static bool _webui_browser_create_new_profile(_webui_window_t* win, size_t brows
52275227
#endif
52285228

52295229
if (!win->custom_profile){
5230-
if(!win->disable_browser_high_contrast)
5231-
WEBUI_SN_PRINTF_DYN(win->profile_path, WEBUI_MAX_PATH, "%s%s.WebUI%sWebUIFirefoxProfile", temp, os_sep, os_sep);
5232-
else
5233-
WEBUI_SN_PRINTF_DYN(win->profile_path, WEBUI_MAX_PATH, "%s%s.WebUI%sWebUIFirefoxProfile-NoHC", temp, os_sep, os_sep);
5230+
// Set Firefox profile folder name
5231+
const char* ff = "FirefoxProfile";
5232+
if(!win->disable_browser_high_contrast) {
5233+
ff = "WebUIFirefoxProfile-NoHC";
5234+
}
5235+
// Generate Firefox profile path
5236+
if (WEBUI_SN_PRINTF_DYN(win->profile_path, WEBUI_MAX_PATH, "%s%s.WebUI%s%s",
5237+
temp, os_sep, os_sep, ff) >= WEBUI_MAX_PATH) {
5238+
// Generated path is too big
5239+
#ifdef WEBUI_LOG
5240+
printf(
5241+
"[Core]\t\t_webui_browser_create_new_profile(%zu) -> "
5242+
"Generated Firefox profile folder path is too big\n",
5243+
browser
5244+
);
5245+
#endif
5246+
return false;
5247+
}
52345248
}
52355249

52365250
if (!_webui_folder_exist(win->profile_path) ||

0 commit comments

Comments
 (0)