diff --git a/source/modes/script.c b/source/modes/script.c index abcb445f..5c5a1b33 100644 --- a/source/modes/script.c +++ b/source/modes/script.c @@ -467,7 +467,7 @@ void script_mode_gather_user_scripts(void) { const char *file = NULL; while ((file = g_dir_read_name(sd)) != NULL) { char *sp = g_build_filename(cpath, "rofi", "scripts", file, NULL); - user_scripts = g_realloc(user_scripts, num_scripts + 1); + user_scripts = g_realloc(user_scripts, sizeof(ScriptUser)*(num_scripts + 1)); user_scripts[num_scripts].path = sp; user_scripts[num_scripts].name = g_strdup(file); char *dot = strrchr(user_scripts[num_scripts].name, '.'); diff --git a/source/view.c b/source/view.c index ae707190..e4f3c2b0 100644 --- a/source/view.c +++ b/source/view.c @@ -199,7 +199,7 @@ void rofi_capture_screenshot(void) { if (outp == NULL) { int index = 0; fpath = g_build_filename(xdg_pict_dir, filename, NULL); - while (g_file_test(fpath, G_FILE_TEST_EXISTS) && index < 99) { + while (g_file_test(fpath, G_FILE_TEST_EXISTS) && index < 99999) { g_free(fpath); g_free(filename); // Try the next index.