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;