Fixed !BN_copy() to BN_copy() == NULL to match openssl coding style#30573
Fixed !BN_copy() to BN_copy() == NULL to match openssl coding style#30573ams4222 wants to merge 1 commit intoopenssl:masterfrom
Conversation
|
Tagging @bbbrumley for visibility! |
| goto end; | ||
|
|
||
| err = !BN_copy(A, a); | ||
| err = (BN_copy(A, a) == NULL); |
There was a problem hiding this comment.
per coding style, the project likely prefers to drop the outer parenthesis here for readability
| goto end; | ||
| err = !BN_copy(B, b); | ||
| err = (BN_copy(B, b) == NULL); | ||
| if (err) |
There was a problem hiding this comment.
NIT: per coding style, the project likely prefers to drop the outer parenthesis here for readability
|
@ams4222 thank you for the PR! I went through all lines of the diff, only spotted those two nits. Good job 👍 Go ahead and bring this out of DRAFT status, and let's get feedback from the maintainers. (idk if they'll take a CLA waiver for this. Let's see.) |
|
Thank you for the new commit! Don't worry about the CLA check failure, it'll fall off when the commits get squashed. LGTM, maintainers will chime in soon ;) |
|
Although this is technically not copyrightable change, I think, we would still prefer if you could please sign CLA. |
Fixes openssl#30565 CLA: trivial
|
Filled out the CLA |
|
This pull request is ready to merge |
Per the coding style guide, Chapter 15, "Expressions"[1]:
Do not use implicit checks for numbers (not) being 0 or pointers
(not) being NULL.
Change occurrences of "!BN_copy(a, b)" checks to "BN_copy() == NULL"
to align with the coding style guide.
[1] https://www.openssl.org/policies/technical/coding-style.html#expressions
Resolves: #30565
CLA: trivial
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Tue Mar 31 00:10:41 2026
(Merged from #30573)
|
Pushed to |
This PR cleans code to align with the coding style guide OpenSSL provides.
The
BN_copyfunction returns aBIGNUM *. If there is an error, it returnsNULL.Before code cleanup:
if (!BN_copy(a, b))This is an implicit check that checks if
BIGNUM *isNULL. This goes against the coding style guidelines in Chapter 15.After code cleanup:
if (BN_copy(a, b) == NULL)This code change eliminates that implicit form to explicitly check if
BIGNUM *isNULL.All 99 instances of this implicit check have been resolved.
Fixes #30565