commit 994fc034e547f35a995439782ed45bfd12f8b1be from: Omar Polo date: Sat Jul 01 14:11:21 2023 UTC avoid needless strlen() commit - e2003e7e305adabd1ee575e401a55e6d7e050297 commit + 994fc034e547f35a995439782ed45bfd12f8b1be blob - ab93b1657221a6aed50e3863bbf7143693d3aa6d blob + 168839083dfc019576c8d771ee466c13c6fa9394 --- server.c +++ 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; }