From 8da59918c22df70eaec28150867c7e8bfd4bc1ae Mon Sep 17 00:00:00 2001 From: Niklas Halle Date: Thu, 21 May 2020 14:11:38 +0200 Subject: sdfghj --- 02_exercise/prompt_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '02_exercise/prompt_utils.c') diff --git a/02_exercise/prompt_utils.c b/02_exercise/prompt_utils.c index b7c836b..d43a6b6 100644 --- a/02_exercise/prompt_utils.c +++ b/02_exercise/prompt_utils.c @@ -58,7 +58,7 @@ char const *relative_path(char const *const from_dir, char const *const to_dir) } else { char const *const go_up = "/.."; size_t length = strlen(to_dir + common_position) + strlen("..") + - strlen(go_up) * (levels_up - 1); + strlen(go_up) * (levels_up - 1) + 1; return_value = malloc(length * sizeof(char)); strcpy(return_value, ".."); for (size_t j = 0; j < levels_up - 1; ++j) { -- cgit v1.2.3-54-g00ecf