bio_print.c: Delete unreachable code at lines 710 and 711

CLA: trivial

The purpose of adding the conditional operator on line 710 is to check
if the value of the variable 'fplace' exceeds the size of the array
'fconvert', and to reduce the value of 'fplace' by 1, so that later on
we can set the value to zero of the array element with the index 'fplace'
and not make any calls beyond the array edges.

However, the condition on line 710 will always be false, because
the size of 'fconvert' is strictly specified at the beginning of
the 'fmtfp()' function (line 571), so it is reasonable to remove
this conditional operator, as well as the unreachable decrementation
code of the variable 'fplace'.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21325)
This commit is contained in:
MrRurikov 2023-06-29 17:06:08 +03:00 committed by Tomas Mraz
parent 3ced3a44e8
commit 8ae4b23634

View File

@ -707,8 +707,6 @@ fmtfp(char **sbuffer,
fracpart = (fracpart / 10);
}
if (fplace == sizeof(fconvert))
fplace--;
fconvert[fplace] = 0;
/* convert exponent part */