Skip to content

Commit

Permalink
Bug fix pointer clobber
Browse files Browse the repository at this point in the history
  • Loading branch information
linas committed May 30, 2024
1 parent 13761b2 commit 1a4775a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions link-parser/lg_readline.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 1a4775a

Please sign in to comment.