aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/main.c b/main.c
index 9dd0eec..bc1f589 100644
--- a/main.c
+++ b/main.c
@@ -15,6 +15,8 @@ static int readlink_realpath(const char *filepath, char *buffer) {
if(bytes_written == -1 && errno == EINVAL) {
/* Not a symlink */
strncpy(symlinked_path, filepath, sizeof(symlinked_path));
+ } else if(bytes_written == -1) {
+ return 0;
} else {
symlinked_path[bytes_written] = '\0';
}