MCPcopy Create free account
hub / github.com/Tencent/Hardcoder / buffer_skip_whitespace

Function buffer_skip_whitespace

libapp2sys/src/main/cpp/cjson/cJSON.c:966–984  ·  view source on GitHub ↗

Utility to jump whitespace and cr/lf */

Source from the content-addressed store, hash-verified

964
965/* Utility to jump whitespace and cr/lf */
966static parse_buffer *buffer_skip_whitespace(parse_buffer * const buffer)
967{
968 if ((buffer == NULL) || (buffer->content == NULL))
969 {
970 return NULL;
971 }
972
973 while (can_access_at_index(buffer, 0) && (buffer_at_offset(buffer)[0] <= 32))
974 {
975 buffer->offset++;
976 }
977
978 if (buffer->offset == buffer->length)
979 {
980 buffer->offset--;
981 }
982
983 return buffer;
984}
985
986/* skip the UTF-8 BOM (byte order mark) if it is at the beginning of a buffer */
987static parse_buffer *skip_utf8_bom(parse_buffer * const buffer)

Callers 3

cJSON_ParseWithOptsFunction · 0.85
parse_arrayFunction · 0.85
parse_objectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected