| 146 | } |
| 147 | |
| 148 | static void append_text_atom(char *buf, size_t bufsz, size_t *pos, const char *s) { |
| 149 | if (!s) { |
| 150 | return; |
| 151 | } |
| 152 | while (*s) { |
| 153 | unsigned char ch = (unsigned char)*s++; |
| 154 | if (ch <= ' ' || ch == 0x7f) { |
| 155 | append_char(buf, bufsz, pos, '_'); |
| 156 | } else { |
| 157 | append_char(buf, bufsz, pos, (char)ch); |
| 158 | } |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | static void append_json_string(char *buf, size_t bufsz, size_t *pos, const char *s) { |
| 163 | append_char(buf, bufsz, pos, '"'); |
no test coverage detected