1
0
Fork 0
mirror of https://git.sr.ht/~sircmpwn/gmni synced 2024-05-04 19:06:03 +02:00

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
This commit is contained in:
Giuseppe Lumia 2021-01-07 09:15:33 +01:00 committed by Drew DeVault
parent ff8c869b5e
commit 4fbc632b22
2 changed files with 3 additions and 3 deletions

View File

@ -338,7 +338,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);
}

View File

@ -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));