From 30359dae2f70c92ae661581a0d1fccdf4c078c79 Mon Sep 17 00:00:00 2001 From: pommicket Date: Thu, 11 Sep 2025 21:43:03 -0400 Subject: Fix UTF-8 decoding --- pom.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pom.c b/pom.c index 118d9d6..9a4028e 100644 --- a/pom.c +++ b/pom.c @@ -1,8 +1,3 @@ -/* -TODO: -- check for valid UTF-8 -*/ - #include "pom.h" #include // still needed for sprintf, even if POM_NO_STDIO is defined. @@ -291,7 +286,6 @@ parser_read_to_buf(struct parser *parser, bool skip_bom) { goto eof; if (read_count < sizeof parser->buf - 1) parser->short_read = true; - parser->utf8_state = utf8_state; if (parser->leftover_cr && buf[0] != '\n') parser_error(parser, "Carriage return with no newline after it."); size_t in = 0, out = 0; @@ -384,6 +378,7 @@ parser_read_to_buf(struct parser *parser, bool skip_bom) { } buf[out++] = byte; } + parser->utf8_state = utf8_state; parser->line_number = original_line_number; parser->buf_count = out; return true; -- cgit v1.2.3