duration.c:66:6: warning: array subscript is of type 'char' on NetBSD 9
I get the following warning on NetBSD 9.3:
duration.c:66:6: warning: array subscript is of type 'char' [-Wchar-subscripts]
if (toupper(str[0]) != 'P') {
^~~~~~~~~~~~~~~
/usr/include/sys/ctype_inline.h:60:46: note: expanded from macro 'toupper'
#define toupper(c) ((int)((_toupper_tab_ + 1)[(c)]))
^~~~
Fix:
diff --git a/lib/isccfg/duration.c b/lib/isccfg/duration.c
index 27dddca1cc..305047e1af 100644
--- a/lib/isccfg/duration.c
+++ b/lib/isccfg/duration.c
@@ -63,7 +63,7 @@ isccfg_duration_fromtext(isc_textregion_t *source,
duration->unlimited = false;
/* Every duration starts with 'P' */
- if (toupper(str[0]) != 'P') {
+ if (toupper((unsigned char)str[0]) != 'P') {
return (ISC_R_BADNUMBER);
}
P = str;