From c88baab41c58bac6dce5e2995e9b1508373bff4f Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Tue, 22 Mar 2005 17:37:40 +0000 Subject: dirname may modify the string, so copy it first --- mdk-stage1/disk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mdk-stage1/disk.c') diff --git a/mdk-stage1/disk.c b/mdk-stage1/disk.c index 9a4e97166..1579ddaa4 100644 --- a/mdk-stage1/disk.c +++ b/mdk-stage1/disk.c @@ -93,9 +93,11 @@ static enum return_type try_with_device(char *dev_name) strcat(location_full, answers_location[0]); if (access(location_full, R_OK)) { + char * path = strdup(answers_location[0]); stg1_error_message("Directory or ISO image file could not be found on partition.\n" "Here's a short extract of the files in the directory %s:\n" - "%s", dirname(answers_location[0]), extract_list_directory(dirname(location_full))); + "%s", dirname(path), extract_list_directory(dirname(location_full))); + free(path); goto ask_dir; } -- cgit v1.2.1