fix handling of / as cgi prefix
authorFelix Fietkau <nbd@openwrt.org>
Mon, 7 Apr 2014 22:42:04 +0000 (00:42 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 7 Apr 2014 22:42:04 +0000 (00:42 +0200)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
main.c

diff --git a/main.c b/main.c
index 38d023fa1699b8ee52c716f0de5457696688dbff..e89a99a765240d06a7485ada879f87bc8a25c81c 100644 (file)
--- a/main.c
+++ b/main.c
@@ -201,7 +201,7 @@ static void fixup_prefix(char *str)
 
        len = strlen(str) - 1;
 
-       while (len > 0 && str[len] == '/')
+       while (len >= 0 && str[len] == '/')
                len--;
 
        str[len + 1] = 0;