summaryrefslogtreecommitdiffstats
path: root/02_exercise/prompt_utils.c
diff options
context:
space:
mode:
authorStefan Zabka <zabkaste@hu-berlin.de>2020-05-21 17:46:10 +0200
committerStefan Zabka <zabkaste@hu-berlin.de>2020-05-21 17:46:10 +0200
commit45b35365a5d0f895caeb6178f5f0a70cfe4464ee (patch)
treebc291ece0cf297f50ba48e8d874a2145721a445f /02_exercise/prompt_utils.c
parent0465e79da49900bbd66216d979876654f8977e30 (diff)
parent8da59918c22df70eaec28150867c7e8bfd4bc1ae (diff)
downloadbetriebssysteme-45b35365a5d0f895caeb6178f5f0a70cfe4464ee.tar.gz
betriebssysteme-45b35365a5d0f895caeb6178f5f0a70cfe4464ee.zip
Merge branch 'master' of git.niklashalle.net:uni/sem6/betriebssysteme
Diffstat (limited to '02_exercise/prompt_utils.c')
-rw-r--r--02_exercise/prompt_utils.c2
1 files changed, 1 insertions, 1 deletions
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) {