summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-10-31 22:33:12 +0100
committerJo-Philipp Wich <jo@mein.io>2020-10-31 22:39:42 +0100
commit55578a56b73dff5374e4b9c59dcece96f86714f9 (patch)
tree2830ad1cd96863935b2b93d103154704a097cdc2
parent3fe96c552080619a02e6fa0b085c2b1ad32805b6 (diff)
main: fix leading byte corruption when not starting with #!
Reverse the order of the ungetc() calls to properly restore the first two probed bytes. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main.c b/main.c
index 2abe485..881b8fd 100644
--- a/main.c
+++ b/main.c
@@ -162,8 +162,8 @@ parse(struct ut_state *state, struct ut_source *src, bool dumponly,
}
}
else {
- ungetc(c, src->fp);
ungetc(c2, src->fp);
+ ungetc(c, src->fp);
}
}