cgmnlm

Unnamed repository; edit this file 'description' to name the repository.
git clone git://code.clttr.info/cgmnlm.git
Log | Files | Refs | README | LICENSE

commit 0ed7a4527c967ce3f14909923277cf62624f0900
parent 6d2f78eeded101ccd755b1b2be16105fe5af881d
Author: Giuseppe Lumia <g.lumia@outlook.com>
Date:   Thu,  7 Jan 2021 09:15:33 +0100

Fix OpenBSD compilation errors

Those changes fix the following compilation errors on OpenBSD:

src/tofu.c:128:28: error: format specifies type 'long' but the argument has type
      'time_t' (aka 'long long') [-Werror,-Wformat]
                        "SHA-512", fingerprint, expires);

src/gmnlm.c:341:31: error: missing sentinel in function call
      [-Werror,-Wsentinel]
                execlp("sh", "sh", "-c", cmd);
                                            ^
                                            , NULL

Diffstat:
Msrc/gmnlm.c | 2+-
Msrc/tofu.c | 4++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gmnlm.c b/src/gmnlm.c @@ -349,7 +349,7 @@ pipe_resp(FILE *out, struct gemini_response resp, char *cmd) { close(pfd[1]); dup2(pfd[0], STDIN_FILENO); close(pfd[0]); - execlp("sh", "sh", "-c", cmd); + execlp("sh", "sh", "-c", cmd, NULL); perror("exec"); _exit(1); } diff --git a/src/tofu.c b/src/tofu.c @@ -124,8 +124,8 @@ callback: struct tm expires_tm; ASN1_TIME_to_tm(notAfter, &expires_tm); time_t expires = mktime(&expires_tm); - fprintf(f, "%s %s %s %ld\n", servername, - "SHA-512", fingerprint, expires); + fprintf(f, "%s %s %s %jd\n", servername, + "SHA-512", fingerprint, (intmax_t)expires); fclose(f); host = calloc(1, sizeof(struct known_host));