MCPcopy Create free account
hub / github.com/DaveGamble/cJSON / buffer_skip_whitespace

Function buffer_skip_whitespace

cJSON.c:1085–1108  ·  view source on GitHub ↗

Utility to jump whitespace and cr/lf */

Source from the content-addressed store, hash-verified

1083
1084/* Utility to jump whitespace and cr/lf */
1085static parse_buffer *buffer_skip_whitespace(parse_buffer * const buffer)
1086{
1087 if ((buffer == NULL) || (buffer->content == NULL))
1088 {
1089 return NULL;
1090 }
1091
1092 if (cannot_access_at_index(buffer, 0))
1093 {
1094 return buffer;
1095 }
1096
1097 while (can_access_at_index(buffer, 0) && (buffer_at_offset(buffer)[0] <= 32))
1098 {
1099 buffer->offset++;
1100 }
1101
1102 if (buffer->offset == buffer->length)
1103 {
1104 buffer->offset--;
1105 }
1106
1107 return buffer;
1108}
1109
1110/* skip the UTF-8 BOM (byte order mark) if it is at the beginning of a buffer */
1111static parse_buffer *skip_utf8_bom(parse_buffer * const buffer)

Callers 3

parse_arrayFunction · 0.85
parse_objectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…