From 3962978bddbafdcfd94538887e5ce10c698e209a Mon Sep 17 00:00:00 2001 From: FRIGN Date: Thu, 14 Aug 2014 14:18:40 +0200 Subject: [PATCH] Increase clarity of the len-check --- quark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quark.c b/quark.c index 4fb065d..c6fa799 100644 --- a/quark.c +++ b/quark.c @@ -273,7 +273,7 @@ responsedir(void) { size_t len = strlen(reqbuf); DIR *d; - if (len && (reqbuf[len - 1] != '/') && (len + 1 < MAXBUFLEN)) { + if (len > 0 && (reqbuf[len - 1] != '/') && (len + 1 < MAXBUFLEN)) { /* add directory terminator if necessary */ reqbuf[len] = '/'; reqbuf[len + 1] = 0;