Drop redundant non-negative checks on unsigned values

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/25341)
This commit is contained in:
Viktor Dukhovni 2024-08-31 12:27:33 +10:00 committed by Tomas Mraz
parent 6fd9bc6568
commit 8439337036

View File

@ -98,9 +98,6 @@ static int encode(unsigned const char *buf, unsigned buflen, char *encoded,
int pos = 0;
char nl = '\n';
if (buflen < 0)
return 0;
/* Use a verbatim encoding when provided */
if (encoded != NULL) {
int elen = strlen(encoded);
@ -317,7 +314,7 @@ static int generic_case(test_case *t, int verbose)
int ok = 1;
for (llen = linelengths; *llen > 0; ++llen) {
for (wscnt = wscnts; *wscnt >= 0 && *wscnt * 2 < *llen; ++wscnt) {
for (wscnt = wscnts; *wscnt * 2 < *llen; ++wscnt) {
int extra = t->no_nl ? 64 : 0;
/*