repositories
/
advent21.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
day 17 part one
[advent21.git]
/
16b.c
diff --git
a/16b.c
b/16b.c
index
437560e
..
6c93a16
100644
(file)
--- a/
16b.c
+++ b/
16b.c
@@
-14,13
+14,8
@@
struct stream { int pos; char *buf; };
int next(struct stream *f)
{
int r;
- if (*f->buf == '\0') {
- if ((r = getchar()) == EOF) {
- printf("EOF\n");
- exit(1);
- }
+ if (*f->buf == '\0')
f->buf = hex2bin[r];
- }
r =*(f->buf++) == '1' ? 1 : 0;
f->pos++;
return r;