From 684646c8b9d3a48080661a71edeff9c874a23656 Mon Sep 17 00:00:00 2001 From: Hideki Miyazaki Date: Sat, 24 Dec 2022 09:03:10 +0900 Subject: [PATCH] fix shadows min and subscript by i486-netbsd-gcc --- src/ssl.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ssl.c b/src/ssl.c index 8e7e3eee8..48ec5611b 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -25287,8 +25287,8 @@ int wolfSSL_ASN1_TIME_check(const WOLFSSL_ASN1_TIME* a) /* * Convert time to Unix time (GMT). */ -static long long TimeToUnixTime(int sec, int min, int hour, int mday, int mon, - int year) +static long long TimeToUnixTime(int sec, int minute, int hour, int mday, + int mon, int year) { /* Number of cumulative days from the previous months, starting from * beginning of January. */ @@ -25304,8 +25304,8 @@ static long long TimeToUnixTime(int sec, int min, int hour, int mday, int mon, 1969 / 100 - 1969 / 400; return ((((long long) (year - 1970) * 365 + leapDays + - monthDaysCumulative[mon] + mday - 1) * 24 + hour) * 60 + min) * 60 + - sec; + monthDaysCumulative[mon] + mday - 1) * 24 + hour) * 60 + minute) * + 60 + sec; } int wolfSSL_ASN1_TIME_diff(int *days, int *secs, const WOLFSSL_ASN1_TIME *from, @@ -29544,10 +29544,10 @@ int wolfSSL_ASN1_STRING_canon(WOLFSSL_ASN1_STRING* asn_out, /* trimming spaces at the head and tail */ dst--; - for (; (len > 0 && XISSPACE(*dst)); len--) { + for (; (len > 0 && XISSPACE((unsigned char)*dst)); len--) { dst--; } - for (; (len > 0 && XISSPACE(*src)); len--) { + for (; (len > 0 && XISSPACE((unsigned char)*src)); len--) { src++; } @@ -29558,10 +29558,10 @@ int wolfSSL_ASN1_STRING_canon(WOLFSSL_ASN1_STRING* asn_out, if (!XISASCII(*src)) { /* keep non-ascii code */ *dst = *src++; - } else if (XISSPACE(*src)) { + } else if ((*src) > 0 && XISSPACE((unsigned char)*src)) { *dst = 0x20; /* space */ /* remove the rest of spaces */ - while (XISSPACE(*++src) && i++ < len); + while (XISSPACE((unsigned char)*++src) && i++ < len); } else { *dst = (char)XTOLOWER((unsigned char)*src++); }