diff options
| author | Tyge Løvset <[email protected]> | 2023-02-27 09:57:33 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2023-02-27 10:16:59 +0100 |
| commit | d37820ddc211aec2876950cd4f2236cc9b92c9eb (patch) | |
| tree | 79a2fd040b214d2904860115cb8e6c888a973ff7 /misc/examples/coread.c | |
| parent | 31459ecefc0d54399eafd9a18303868625f57a7c (diff) | |
| download | STC-modified-d37820ddc211aec2876950cd4f2236cc9b92c9eb.tar.gz STC-modified-d37820ddc211aec2876950cd4f2236cc9b92c9eb.zip | |
Let cco_end(value) return value. Should be last in function anyway.
Assume context always non-NULL when calling cco_alive(context).
Diffstat (limited to 'misc/examples/coread.c')
| -rw-r--r-- | misc/examples/coread.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/misc/examples/coread.c b/misc/examples/coread.c index 3d49c5df..4df80339 100644 --- a/misc/examples/coread.c +++ b/misc/examples/coread.c @@ -24,8 +24,7 @@ bool file_nextline(struct file_nextline* U) printf("finish\n"); cstr_drop(&U->line); fclose(U->fp); - cco_end(); - return false; + cco_end(false); } int main(void) { @@ -33,9 +32,6 @@ int main(void) { int n = 0; while (file_nextline(&z)) { printf("%3d %s\n", ++n, cstr_str(&z.line)); - - // stop after 15 lines: - if (n == 15) (void)cco_stop(&z); } printf("state %d\n", z.cco_state); } |
