Skip to content

Commit 5db1a91

Browse files
committed
Address review comments.
1 parent ef931bf commit 5db1a91

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/code-quality/c26835.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ helpviewer_keywords: ["C26835"]
1111
1212
## Remarks
1313

14-
When `RtlCompareMemory`'s return value is used in a boolean context (compared to 0 or converted to bool), it evaluates to true if there is at least 1 byte that is equal before finding a difference. This behavior is often not intentional. To check for equality, consider using `RtlEqualMemory` instead.
14+
When `RtlCompareMemory`'s return value is used in a boolean context, it evaluates to true when there is at least 1 byte that is equal before finding a difference. This behavior is often not intentional. Moreover, comparing the result of `RtlCompareMemory` to 0 evaluates to false if there is at least 1 matching byte. This behavior is different from functions with compare in their name like `strcmp` making the code harder to understand. To check for equality, consider using `RtlEqualMemory` instead.
1515

1616
This warning is available in Visual Studio 2022 version 17.7 and later versions.
1717

0 commit comments

Comments
 (0)