Evaluate arguments of bitstring macros only once.
authorbluhm <bluhm@openbsd.org>
Mon, 26 Aug 2024 11:52:54 +0000 (11:52 +0000)
committerbluhm <bluhm@openbsd.org>
Mon, 26 Aug 2024 11:52:54 +0000 (11:52 +0000)
commit4491bd906279ac5ed280f88e0b77158b6284ff46
tree451c6c08c1d2d96f5af99070226ee730eb7bb807
parentacdebe0390e889e10c40319e8cdc977aae8f04f5
Evaluate arguments of bitstring macros only once.

According to bit_alloc(3) man page the arguments to bitstring macros
are evaluated only once and may safely have side effects.  Fix the
implementation with temporary variables to fulfill this requirement.

OK florian@ deraadt@
include/bitstring.h