diff options
author | lloyd <lloyd@randombit.net> | 2012-10-13 16:37:39 +0000 |
---|---|---|
committer | lloyd <lloyd@randombit.net> | 2012-10-13 16:37:39 +0000 |
commit | 8232b76a8d332fab5a1023b37e8d0a18cc1e0985 (patch) | |
tree | acd12b861439066f4c891dd3bd17e1e46c6e8581 /src | |
parent | 799f72903d65cbdc8a31480e072ad6e1f41c63d8 (diff) |
Add parens to BOTAN_ASSERT_EQUALS, otherwise low precedence ops could
cause problems.
Diffstat (limited to 'src')
-rw-r--r-- | src/utils/assert.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/utils/assert.h b/src/utils/assert.h index 88d514b43..d92b41111 100644 --- a/src/utils/assert.h +++ b/src/utils/assert.h @@ -35,10 +35,10 @@ void assertion_failure(const char* expr_str, /** * Assert that value1 == value2 */ -#define BOTAN_ASSERT_EQUAL(value1, value2, assertion_made) \ +#define BOTAN_ASSERT_EQUAL(expr1, expr2, assertion_made) \ do { \ - if(value1 != value2) \ - Botan::assertion_failure(#value1 " == " #value2, \ + if((expr1) != (expr2)) \ + Botan::assertion_failure(#expr1 " == " #expr2, \ assertion_made, \ __func__, \ __FILE__, \ |