From 565ba6ee76e0217d9bc302404370bb346a975acd Mon Sep 17 00:00:00 2001 From: simon987 Date: Thu, 27 Feb 2020 09:44:19 -0500 Subject: [PATCH] Fix for #29 --- src/util.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/util.c b/src/util.c index 69473ff..898c622 100644 --- a/src/util.c +++ b/src/util.c @@ -259,8 +259,10 @@ char *abspath(const char *path) { if (abs == NULL) { return NULL; } - abs = realloc(abs, strlen(abs) + 2); - strcat(abs, "/"); + if (strlen(abs) > 1) { + abs = realloc(abs, strlen(abs) + 2); + strcat(abs, "/"); + } wordfree(&w); return abs;