diff options
| author | Sam Varshavchik | 2021-05-17 22:48:17 -0400 |
|---|---|---|
| committer | Sam Varshavchik | 2021-05-19 08:03:46 -0400 |
| commit | 34b6dbb743654fdb6edccf101c4da7e671b7a92d (patch) | |
| tree | 9328e2bd91c4fb8bf5f5103e97ca3456b1c09943 /rfc1035/rfc1035str.c | |
| parent | f47a71576c377269f5c5ca6156b2f319256e2738 (diff) | |
| download | courier-libs-34b6dbb743654fdb6edccf101c4da7e671b7a92d.tar.bz2 | |
Tolerate -Wall and -Werror
Fixes to configure scripts and code so that it compiles (hopefully
correctly) with -Wall and -Werror.
Remove support for ancient BSD stricmp and strnicmp functions.
AC_CHECK_FUNC does not work for strcasecmp and strncasecmp under
-Wall, it's simpler to remove it.
Diffstat (limited to 'rfc1035/rfc1035str.c')
| -rw-r--r-- | rfc1035/rfc1035str.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/rfc1035/rfc1035str.c b/rfc1035/rfc1035str.c index 4335369..a010250 100644 --- a/rfc1035/rfc1035str.c +++ b/rfc1035/rfc1035str.c @@ -52,12 +52,6 @@ static struct { const char *name; int num; } typetab[]={ {"UNIMPLEMENTED", 4}, {"REFUSED", 5}}; -#if HAVE_STRCASECMP -#define COMPARE(a,b) strcasecmp((a), (b)) -#else -#define COMPARE(a,b) stricmp((a), (b)) -#endif - void rfc1035_type_itostr(int n, void (*func)(const char *, void *), void *arg) { unsigned i; @@ -82,7 +76,7 @@ int rfc1035_type_strtoi(const char *n) unsigned i; for (i=0; i<sizeof(typetab)/sizeof(typetab[0]); i++) - if (COMPARE(typetab[i].name, n) == 0) return (typetab[i].num); + if (strcasecmp(typetab[i].name, n) == 0) return (typetab[i].num); return (-1); } @@ -100,7 +94,7 @@ int rfc1035_class_strtoi(const char *n) unsigned i; for (i=0; i<sizeof(classtab)/sizeof(classtab[0]); i++) - if (COMPARE(classtab[i].name, n) == 0) return (classtab[i].num); + if (strcasecmp(classtab[i].name, n) == 0) return (classtab[i].num); return (-1); } @@ -118,8 +112,8 @@ int rfc1035_opcode_strtoi(const char *n) unsigned i; for (i=0; i<sizeof(opcodetab)/sizeof(opcodetab[0]); i++) - if (COMPARE(opcodetab[i].name, n) == 0) - return (opcodetab[i].num); + if (strcasecmp(opcodetab[i].name, n) == 0) + return (opcodetab[i].num); return (-1); } @@ -137,7 +131,7 @@ int rfc1035_rcode_strtoi(const char *n) unsigned i; for (i=0; i<sizeof(rcodetab)/sizeof(rcodetab[0]); i++) - if (COMPARE(rcodetab[i].name, n) == 0) - return (rcodetab[i].num); + if (strcasecmp(rcodetab[i].name, n) == 0) + return (rcodetab[i].num); return (-1); } |
