Skip to content

Commit fe7599d

Browse files
author
Olivier Courtin
committed
filter useless (and errorfull) ASCII char for XML output
1 parent 52e3662 commit fe7599d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/struct/buffer.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,9 @@ buffer *buffer_encode_xml_entities_str(const char * str)
502502
buf = buffer_init();
503503

504504
for( /* empty */ ; *str ; str++) {
505+
506+
if ((int) *str < 32 && (*str != '\n' && *str != '\r' && *str != ' ')) break;
507+
505508
switch(*str) {
506509
case '&':
507510
buffer_add_str(buf, "&amp;");

0 commit comments

Comments
 (0)