diff options
| author | Tyge Løvset <[email protected]> | 2022-11-06 16:20:55 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-11-06 16:20:55 +0100 |
| commit | 45c1399985bddf91770c05b383c48a7ade98103b (patch) | |
| tree | 2eed3a6fdf3b2bfac92d287a8a6ca5da27a7881b /examples | |
| parent | 5ec606e5dfdbaebe22717d094b58ee7f365ffd9c (diff) | |
| download | STC-modified-45c1399985bddf91770c05b383c48a7ade98103b.tar.gz STC-modified-45c1399985bddf91770c05b383c48a7ade98103b.zip | |
Fixed recent minor potential bug in examples/bits.c code.
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/bits.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/bits.c b/examples/bits.c index 43a57c51..82fd65ec 100644 --- a/examples/bits.c +++ b/examples/bits.c @@ -7,15 +7,14 @@ int main() printf("count %" c_ZU ", %" c_ZU "\n", cbits_count(&set), cbits_size(&set)); cbits s1 = cbits_from("1110100110111"); char buf[256]; - cbits_to_str(&s1, buf, 0, -1); + cbits_to_str(&s1, buf, 0, 255); printf("buf: %s: %" c_ZU "\n", buf, cbits_count(&s1)); cbits_drop(&s1); cbits_reset(&set, 9); cbits_resize(&set, 43, false); - { char str[128]; - printf(" str: %s\n", cbits_to_str(&set, str, 0, 128)); - } + printf(" str: %s\n", cbits_to_str(&set, buf, 0, 255)); + printf("%4" c_ZU ": ", cbits_size(&set)); c_forrange (i, cbits_size(&set)) printf("%d", cbits_test(&set, i)); |
