diff options
author | Omar Polo <op@omarpolo.com> | 2023-07-01 14:11:21 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2023-07-01 14:11:21 +0000 |
commit | 994fc034e547f35a995439782ed45bfd12f8b1be (patch) | |
tree | 7e1ffbf49dd7d73251c72977d490cc7940557607 /server.c | |
parent | e2003e7e305adabd1ee575e401a55e6d7e050297 (diff) |
avoid needless strlen()
Diffstat (limited to 'server.c')
-rw-r--r-- | server.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -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; } |