aboutsummaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2023-07-01 14:11:21 +0000
committerOmar Polo <op@omarpolo.com>2023-07-01 14:11:21 +0000
commit994fc034e547f35a995439782ed45bfd12f8b1be (patch)
tree7e1ffbf49dd7d73251c72977d490cc7940557607 /server.c
parente2003e7e305adabd1ee575e401a55e6d7e050297 (diff)
avoid needless strlen()
Diffstat (limited to 'server.c')
-rw-r--r--server.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/server.c b/server.c
index ab93b16..1688390 100644
--- a/server.c
+++ b/server.c
@@ -791,11 +791,9 @@ open_dir(struct client *c)
struct stat sb;
const char *index;
char path[PATH_MAX];
- size_t len;
int fd = -1;
- len = strlen(c->iri.path);
- if (len > 0 && !ends_with(c->iri.path, "/")) {
+ if (*c->iri.path != '\0' && !ends_with(c->iri.path, "/")) {
redirect_canonical_dir(c);
return;
}