| 128 | } |
| 129 | |
| 130 | static void append_text_atom(char *buf, size_t bufsz, size_t *pos, const char *s) { |
| 131 | if (!s) { |
| 132 | return; |
| 133 | } |
| 134 | while (*s) { |
| 135 | unsigned char ch = (unsigned char)*s++; |
| 136 | if (ch <= ' ' || ch == 0x7f) { |
| 137 | append_char(buf, bufsz, pos, '_'); |
| 138 | } else { |
| 139 | append_char(buf, bufsz, pos, (char)ch); |
| 140 | } |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | static void append_json_string(char *buf, size_t bufsz, size_t *pos, const char *s) { |
| 145 | append_char(buf, bufsz, pos, '"'); |
no test coverage detected