From eed1dd1e6c6d178999fb7043a66f06fd4018726e Mon Sep 17 00:00:00 2001 From: cy Date: Sun, 16 Apr 2017 04:36:22 +0000 Subject: [PATCH] Use warnx() to issue error message. Reported by: cem MFC after: 1 week X-MFC with: r316993, r316994 --- contrib/ipfilter/lib/parsefields.c | 3 ++- contrib/ipfilter/tools/ipf_y.y | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/ipfilter/lib/parsefields.c b/contrib/ipfilter/lib/parsefields.c index 4d79078a905c..93c3601c9557 100644 --- a/contrib/ipfilter/lib/parsefields.c +++ b/contrib/ipfilter/lib/parsefields.c @@ -1,4 +1,5 @@ #include "ipf.h" +#include extern int nohdrfields; @@ -33,7 +34,7 @@ wordtab_t *parsefields(table, arg) } else { fields = reallocarray(fields, num + 1, sizeof(*fields)); if (fields == NULL) { - perror("memory allocation error at __LINE__ in __FUNCTIOIN__ in __FILE__"); + warnx("memory allocation error at %d in %s in %s", __LINE__, __FUNCTION__, __FILE__); abort(); } } diff --git a/contrib/ipfilter/tools/ipf_y.y b/contrib/ipfilter/tools/ipf_y.y index fc4884434347..26db2a22e45e 100644 --- a/contrib/ipfilter/tools/ipf_y.y +++ b/contrib/ipfilter/tools/ipf_y.y @@ -9,6 +9,7 @@ #include "ipf.h" #include #include +#include #ifdef IPFILTER_BPF # include #endif @@ -2196,7 +2197,7 @@ char *phrase; s = strtok(NULL, " \r\n\t"), i++) { fb = reallocarray(fb, i / 4 + 1, sizeof(*fb)); if (fb == NULL) { - perror("memory allocation error at __LINE__ in __FUNCTION__ in __FILE"); + warnx("memory allocation error at %d in %s in %s", __LINE__, __FUNCTION__, __FILE__); abort(); } l = (u_32_t)strtol(s, NULL, 0);