MCPcopy Index your code
hub / github.com/DaveGamble/cJSON / decode_pointer_inplace

Function decode_pointer_inplace

cJSON_Utils.c:359–390  ·  view source on GitHub ↗

JSON Patch implementation. */

Source from the content-addressed store, hash-verified

357
358/* JSON Patch implementation. */
359static void decode_pointer_inplace(unsigned char *string)
360{
361 unsigned char *decoded_string = string;
362
363 if (string == NULL) {
364 return;
365 }
366
367 for (; *string; (void)decoded_string++, string++)
368 {
369 if (string[0] == '~')
370 {
371 if (string[1] == '0')
372 {
373 decoded_string[0] = '~';
374 }
375 else if (string[1] == '1')
376 {
377 decoded_string[1] = '/';
378 }
379 else
380 {
381 /* invalid escape sequence */
382 return;
383 }
384
385 string++;
386 }
387 }
388
389 decoded_string[0] = '\0';
390}
391
392/* non-broken cJSON_DetachItemFromArray */
393static cJSON *detach_item_from_array(cJSON *array, size_t which)

Callers 2

detach_pathFunction · 0.85
apply_patchFunction · 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…