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

Function minify_string

cJSON.c:2887–2907  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2885}
2886
2887static void minify_string(char **input, char **output) {
2888 (*output)[0] = (*input)[0];
2889 *input += static_strlen("\"");
2890 *output += static_strlen("\"");
2891
2892
2893 for (; (*input)[0] != '\0'; (void)++(*input), ++(*output)) {
2894 (*output)[0] = (*input)[0];
2895
2896 if ((*input)[0] == '\"') {
2897 (*output)[0] = '\"';
2898 *input += static_strlen("\"");
2899 *output += static_strlen("\"");
2900 return;
2901 } else if (((*input)[0] == '\\') && ((*input)[1] == '\"')) {
2902 (*output)[1] = (*input)[1];
2903 *input += static_strlen("\"");
2904 *output += static_strlen("\"");
2905 }
2906 }
2907}
2908
2909CJSON_PUBLIC(void) cJSON_Minify(char *json)
2910{

Callers 1

cJSON_MinifyFunction · 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…