MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / skip_utf8_bom

Function skip_utf8_bom

external/cJSON/cJSON.c:1116–1129  ·  view source on GitHub ↗

skip the UTF-8 BOM (byte order mark) if it is at the beginning of a buffer */

Source from the content-addressed store, hash-verified

1114
1115/* skip the UTF-8 BOM (byte order mark) if it is at the beginning of a buffer */
1116static parse_buffer *skip_utf8_bom(parse_buffer * const buffer)
1117{
1118 if ((buffer == NULL) || (buffer->content == NULL) || (buffer->offset != 0))
1119 {
1120 return NULL;
1121 }
1122
1123 if (can_access_at_index(buffer, 4) && (strncmp((const char*)buffer_at_offset(buffer), "\xEF\xBB\xBF", 3) == 0))
1124 {
1125 buffer->offset += 3;
1126 }
1127
1128 return buffer;
1129}
1130
1131CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, const char **return_parse_end, cJSON_bool require_null_terminated)
1132{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected