skip the UTF-8 BOM (byte order mark) if it is at the beginning of a buffer */
| 985 | |
| 986 | /* skip the UTF-8 BOM (byte order mark) if it is at the beginning of a buffer */ |
| 987 | static parse_buffer *skip_utf8_bom(parse_buffer * const buffer) |
| 988 | { |
| 989 | if ((buffer == NULL) || (buffer->content == NULL) || (buffer->offset != 0)) |
| 990 | { |
| 991 | return NULL; |
| 992 | } |
| 993 | |
| 994 | if (can_access_at_index(buffer, 4) && (strncmp((const char*)buffer_at_offset(buffer), "\xEF\xBB\xBF", 3) == 0)) |
| 995 | { |
| 996 | buffer->offset += 3; |
| 997 | } |
| 998 | |
| 999 | return buffer; |
| 1000 | } |
| 1001 | |
| 1002 | /* Parse an object - create a new root, and populate. */ |
| 1003 | CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, const char **return_parse_end, cJSON_bool require_null_terminated) |
no outgoing calls
no test coverage detected