MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / skipBOM

Function skipBOM

lib/lua/src/lauxlib.c:755–761  ·  view source on GitHub ↗

** Skip an optional BOM at the start of a stream. If there is an ** incomplete BOM (the first character is correct but the rest is ** not), returns the first character anyway to force an error ** (as no chunk can start with 0xEF). */

Source from the content-addressed store, hash-verified

753** (as no chunk can start with 0xEF).
754*/
755static int skipBOM (FILE *f) {
756 int c = getc(f); /* read first character */
757 if (c == 0xEF && getc(f) == 0xBB && getc(f) == 0xBF) /* correct BOM? */
758 return getc(f); /* ignore BOM and return next char */
759 else /* no (valid) BOM */
760 return c; /* return first character */
761}
762
763
764/*

Callers 1

skipcommentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected