| 5287 | */ |
| 5288 | |
| 5289 | static void |
| 5290 | write_xml_string(cups_file_t *fp, /* I - File to write to */ |
| 5291 | const char *s) /* I - String to write */ |
| 5292 | { |
| 5293 | const char *start; /* Start of current sequence */ |
| 5294 | |
| 5295 | |
| 5296 | if (!s) |
| 5297 | return; |
| 5298 | |
| 5299 | for (start = s; *s; s ++) |
| 5300 | { |
| 5301 | if (*s == '&') |
| 5302 | { |
| 5303 | if (s > start) |
| 5304 | cupsFileWrite(fp, start, (size_t)(s - start)); |
| 5305 | |
| 5306 | cupsFilePuts(fp, "&"); |
| 5307 | start = s + 1; |
| 5308 | } |
| 5309 | else if (*s == '<') |
| 5310 | { |
| 5311 | if (s > start) |
| 5312 | cupsFileWrite(fp, start, (size_t)(s - start)); |
| 5313 | |
| 5314 | cupsFilePuts(fp, "<"); |
| 5315 | start = s + 1; |
| 5316 | } |
| 5317 | } |
| 5318 | |
| 5319 | if (s > start) |
| 5320 | cupsFilePuts(fp, start); |
| 5321 | } |
no test coverage detected