]> sigrok.org Git - libsigrok.git/commit - src/strutil.c
strutil: accept 0b prefix when base is 2 (which is non-zero)
authorGerhard Sittig <redacted>
Sun, 25 Jun 2023 20:47:47 +0000 (22:47 +0200)
committerGerhard Sittig <redacted>
Wed, 12 Jul 2023 18:39:54 +0000 (20:39 +0200)
commit5c462eb3c874ce79ff40eecc3ad9921ede0aad22
tree3c70823d2385f4d21158658615214393192fe2b6
parenta5800e90ab7154b5179c3d95ac988bda715ebbb2
strutil: accept 0b prefix when base is 2 (which is non-zero)

The sr_atoul_base() conversion routine only accepted the 0b binary
prefix when base was 0. Extend this to also accept the 0b prefix when
the caller specified base is 2. This unbreaks a valid use case.
src/strutil.c