Fix http-compatibility stub. - geomyidae - A small C-based gopherd. (gopher://bitreich.org/1/scm/geomyidae)
 (HTM) git clone git://r-36.net/geomyidae
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 73b1a17ecfe53540e39ca60059235ce91c70c932
 (DIR) parent 3a876cbe4fb9b93ecf98decfa79e7f9b27dbc320
 (HTM) Author: Christoph Lohmann <20h@r-36.net>
       Date:   Sat, 22 Jul 2023 17:16:51 +0200
       
       Fix http-compatibility stub.
       
       Diffstat:
         M main.c                              |       4 ++--
       
       1 file changed, 2 insertions(+), 2 deletions(-)
       ---
 (DIR) 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,