summaryrefslogtreecommitdiffhomepage
path: root/examples/bits.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2020-11-03 09:41:36 +0100
committerTyge Løvset <[email protected]>2020-11-03 09:41:36 +0100
commit96a572458d7ab43d19b060a867cf80c37b6473ec (patch)
tree127a7cb11ae3051b70c27819944c0ebcc244747a /examples/bits.c
parentcc8fd2c9d8b5b8170a02ec33168d60bb92cd781d (diff)
downloadSTC-modified-96a572458d7ab43d19b060a867cf80c37b6473ec.tar.gz
STC-modified-96a572458d7ab43d19b060a867cf80c37b6473ec.zip
Small API change c_withbuffer() and doc fix.
Diffstat (limited to 'examples/bits.c')
-rw-r--r--examples/bits.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/bits.c b/examples/bits.c
index 8bb187a6..8e1533cc 100644
--- a/examples/bits.c
+++ b/examples/bits.c
@@ -8,9 +8,8 @@ int main() {
cbitset_reset(&set, 9);
cbitset_resize(&set, 43, false);
- cstr_t str = cbitset_to_str(set);
- c_print(1, " str: {}\n", str.str);
- cstr_del(&str);
+ c_withbuffer (str, char, set.size + 1)
+ c_print(1, " str: {}\n", cbitset_to_str(set, str, 0, -1));
c_print(1, "{:4}: ", set.size);
c_forrange (i, int, set.size)