MCPcopy Create free account
hub / github.com/OpenIPC/firmware / minify_string

Function minify_string

general/package/xmdp/src/cjson/cJSON.c:2793–2813  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2791}
2792
2793static void minify_string(char **input, char **output) {
2794 (*output)[0] = (*input)[0];
2795 *input += static_strlen("\"");
2796 *output += static_strlen("\"");
2797
2798
2799 for (; (*input)[0] != '\0'; (void)++(*input), ++(*output)) {
2800 (*output)[0] = (*input)[0];
2801
2802 if ((*input)[0] == '\"') {
2803 (*output)[0] = '\"';
2804 *input += static_strlen("\"");
2805 *output += static_strlen("\"");
2806 return;
2807 } else if (((*input)[0] == '\\') && ((*input)[1] == '\"')) {
2808 (*output)[1] = (*input)[1];
2809 *input += static_strlen("\"");
2810 *output += static_strlen("\"");
2811 }
2812 }
2813}
2814
2815CJSON_PUBLIC(void) cJSON_Minify(char *json)
2816{

Callers 1

cJSON_MinifyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected