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

Function buffer_skip_whitespace

external/cJSON/cJSON.c:1090–1113  ·  view source on GitHub ↗

Utility to jump whitespace and cr/lf */

Source from the content-addressed store, hash-verified

1088
1089/* Utility to jump whitespace and cr/lf */
1090static parse_buffer *buffer_skip_whitespace(parse_buffer * const buffer)
1091{
1092 if ((buffer == NULL) || (buffer->content == NULL))
1093 {
1094 return NULL;
1095 }
1096
1097 if (cannot_access_at_index(buffer, 0))
1098 {
1099 return buffer;
1100 }
1101
1102 while (can_access_at_index(buffer, 0) && (buffer_at_offset(buffer)[0] <= 32))
1103 {
1104 buffer->offset++;
1105 }
1106
1107 if (buffer->offset == buffer->length)
1108 {
1109 buffer->offset--;
1110 }
1111
1112 return buffer;
1113}
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)

Callers 3

parse_arrayFunction · 0.85
parse_objectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected