diff --git a/wolfcrypt/src/sp_int.c b/wolfcrypt/src/sp_int.c index 4400d6f845..c4d9712fef 100644 --- a/wolfcrypt/src/sp_int.c +++ b/wolfcrypt/src/sp_int.c @@ -18906,13 +18906,11 @@ int sp_todecimal(const sp_int* a, char* str) /* Terminate string. */ str[i] = '\0'; - if (err == MP_OKAY) { - /* Reverse string to big endian. */ - for (j = 0; j <= (i - 1) / 2; j++) { - int c = (unsigned char)str[j]; - str[j] = str[i - 1 - j]; - str[i - 1 - j] = (char)c; - } + /* Reverse string to big endian. */ + for (j = 0; j <= (i - 1) / 2; j++) { + int c = (unsigned char)str[j]; + str[j] = str[i - 1 - j]; + str[i - 1 - j] = (char)c; } }