From 875a6e70356b6bc3d6d72d8d2a91d9012ec641e7 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Thu, 17 Sep 2020 12:16:34 -0700 Subject: [PATCH 1/2] include strings.h for str(n)casecmp These POSIX functions are declared in strings.h, so include this header explicitly instead of relying on the libc's default feature-test macros to include it through string.h. --- magrep.c | 1 + mdeliver.c | 1 + mflow.c | 1 + mhdr.c | 1 + 4 files changed, 4 insertions(+) diff --git a/magrep.c b/magrep.c index 6f93a57..72ce1bb 100644 --- a/magrep.c +++ b/magrep.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include "blaze822.h" diff --git a/mdeliver.c b/mdeliver.c index 161cea5..27c4b9c 100644 --- a/mdeliver.c +++ b/mdeliver.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include "blaze822.h" diff --git a/mflow.c b/mflow.c index af6755d..1013da5 100644 --- a/mflow.c +++ b/mflow.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include "blaze822.h" diff --git a/mhdr.c b/mhdr.c index d434d1d..83bed02 100644 --- a/mhdr.c +++ b/mhdr.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include "blaze822.h" From 33ea06a5b61debdf9bbced2bc546b342ab4aa0cc Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Thu, 17 Sep 2020 12:24:08 -0700 Subject: [PATCH 2/2] mpick: use function pointer type for callback Though POSIX requires this conversion to work correctly (for dlsym), it is not valid in ISO C, so it is better to just uses the appropriate function pointer type. --- mpick.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpick.c b/mpick.c index 379200d..3b11e67 100644 --- a/mpick.c +++ b/mpick.c @@ -1466,7 +1466,7 @@ main(int argc, char *argv[]) xpledge("stdio rpath wpath cpath proc exec", 0); - void *cb = need_thr ? collect : oneline; + void (*cb)(char *) = need_thr ? collect : oneline; if (argc == optind && isatty(0)) i = blaze822_loop1(":", cb); else