From 1a4775aefcdf609c4ad1f7f7b9150454eb7a3836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linas=20Vep=C5=A1tas?= Date: Thu, 30 May 2024 12:34:26 -0500 Subject: [PATCH] Bug fix pointer clobber --- link-parser/lg_readline.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/link-parser/lg_readline.c b/link-parser/lg_readline.c index 4bcdf1c1b..04a206666 100644 --- a/link-parser/lg_readline.c +++ b/link-parser/lg_readline.c @@ -74,18 +74,17 @@ void find_history_filepath(const char *dictname, const char *argv0, dictpref[strcspn(dictpref, ":")] = '\0'; // Find the location of the history file. - const char *hfile = xdg_make_path(XDG_BD_STATE, "%s/%s%s", xdg_prog, - dictpref, history_file_basename); + history_file = xdg_make_path(XDG_BD_STATE, "%s/%s%s", xdg_prog, + dictpref, history_file_basename); free(dictpref); - if (NULL == hfile) + if (NULL == history_file) { prt_error("Warning: xdg_get_home(XDG_BD_STATE) failed; " "input history will not be supported.\n"); history_file = strdup("dev/null"); } - history_file = hfile; if (get_verbosity() == D_USER_FILES) prt_error("Debug: Using history file \"%s\"\n", history_file); }