summaryrefslogtreecommitdiffstats
path: root/util.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-11-29 16:50:31 -0500
committerTavian Barnes <tavianator@tavianator.com>2020-11-30 16:13:51 -0500
commit35ff0a8910cc072d6a020819b33fa840800c2815 (patch)
tree3bf2a7fb120c5f37e60e0d87f7f0ff5ef86aa2a4 /util.c
parent85c6aebb5724e292c59ebc77320db55672f49070 (diff)
downloadbfs-35ff0a8910cc072d6a020819b33fa840800c2815.tar.xz
util: Use fgetc(stdin) instead of getchar()
On FreeBSD the getchar() macro leads to (spurious?) msan uninitialized value errors. Call the fgetc() library function to work around it.
Diffstat (limited to 'util.c')
-rw-r--r--util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util.c b/util.c
index 51336ff..3ba8053 100644
--- a/util.c
+++ b/util.c
@@ -262,7 +262,7 @@ static char *xgetline(void) {
}
while (true) {
- int c = getchar();
+ int c = fgetc(stdin);
if (c == '\n' || c == EOF) {
break;
}