about summary refs log tree commit diff
path: root/lr.c
diff options
context:
space:
mode:
Diffstat (limited to 'lr.c')
-rw-r--r--lr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lr.c b/lr.c
index 08d849f..c680cd8 100644
--- a/lr.c
+++ b/lr.c
@@ -2259,7 +2259,7 @@ traverse(const char *path)
 	}
 
 	prefixl = strlen(path);
-	while (path[prefixl-1] == '/')
+	while (prefixl && path[prefixl-1] == '/')
 		prefixl--;
 	if (prefixl > PATH_MAX) {
 		errno = ENAMETOOLONG;