]> sigrok.org Git - libsigrok.git/commit
strutil: support special case in power of two calculation
authorGerhard Sittig <redacted>
Thu, 21 Dec 2023 20:20:55 +0000 (21:20 +0100)
committerGerhard Sittig <redacted>
Thu, 21 Dec 2023 20:34:24 +0000 (21:34 +0100)
commitc3ada48afce7626a980c89e66d592a4242362c57
treebe9863442e32354877a94ae333df9621c23b336b
parent5f50d6da1bc5cc5b48fdc6d4f1775313e97fb1d2
strutil: support special case in power of two calculation

The sr_next_power_of_two() helper routine rejected input value 0
(an index), considered this case invalid. It is not, requires 1 bit
to hold the value. Return a "power of two" value of 1 for that input,
callers expect that result.
src/strutil.c