Skip to content

Commit b6f6498

Browse files
Add parens around ROUND_TO_ALIGN's parameter.
This makes the macro robust against a hypothetical ROUND_TO_ALIGN(foo ? sizeA : size B) invocation.
1 parent f2d9aea commit b6f6498

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static SECP256K1_INLINE void *checked_realloc(const secp256k1_callback* cb, void
113113
#define ALIGNMENT 16
114114
#endif
115115

116-
#define ROUND_TO_ALIGN(size) (((size + ALIGNMENT - 1) / ALIGNMENT) * ALIGNMENT)
116+
#define ROUND_TO_ALIGN(size) ((((size) + ALIGNMENT - 1) / ALIGNMENT) * ALIGNMENT)
117117

118118
/* Assume there is a contiguous memory object with bounds [base, base + max_size)
119119
* of which the memory range [base, *prealloc_ptr) is already allocated for usage,

0 commit comments

Comments
 (0)