MCPcopy Create free account
hub / github.com/Netis/cloud-probe / decode_pointer_inplace

Function decode_pointer_inplace

cpworker/src/cJSON/cJSON_Utils.c:365–397  ·  view source on GitHub ↗

JSON Patch implementation. */

Source from the content-addressed store, hash-verified

363
364/* JSON Patch implementation. */
365static void decode_pointer_inplace(unsigned char *string)
366{
367 unsigned char *decoded_string = string;
368
369 if (string == NULL)
370 {
371 return;
372 }
373
374 for (; *string; (void)decoded_string++, string++)
375 {
376 if (string[0] == '~')
377 {
378 if (string[1] == '0')
379 {
380 decoded_string[0] = '~';
381 }
382 else if (string[1] == '1')
383 {
384 decoded_string[1] = '/';
385 }
386 else
387 {
388 /* invalid escape sequence */
389 return;
390 }
391
392 string++;
393 }
394 }
395
396 decoded_string[0] = '\0';
397}
398
399/* non-broken cJSON_DetachItemFromArray */
400static 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