geomyidae

A small C-based gopherd. (gopher://bitreich.org/1/scm/geomyidae)
git clone git://r-36.net/geomyidae
Log | Files | Refs | README | LICENSE

commit 73b1a17ecfe53540e39ca60059235ce91c70c932
parent 3a876cbe4fb9b93ecf98decfa79e7f9b27dbc320
Author: Christoph Lohmann <20h@r-36.net>
Date:   Sat, 22 Jul 2023 17:16:51 +0200

Fix http-compatibility stub.

Diffstat:
Mmain.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/main.c b/main.c @@ -191,11 +191,11 @@ handlerequest(int sock, char *req, int rlen, char *base, char *ohost, * Try to guess if we have some HTTP-like protocol compatibility * mode. */ - if (!nocgi && recvb[0] != '/' && (c = strchr(recvb, " "))) { + if (!nocgi && recvb[0] != '/' && (c = strchr(recvb, ' '))) { *c = '\0'; if (strchr(recvb, '/')) goto dothegopher; - if (snprintf(path, "%s/%s", base, recvb) <= sizeof(path)) { + if (snprintf(path, sizeof(path), "%s/%s", base, recvb) <= sizeof(path)) { if (realpath(path, (char *)rpath)) { if (stat(rpath, &dir)) { handlecgi(sock, rpath, port, base, NULL, NULL, ohost,