convert all control chars into spaces to be xml 1.0 conform
This commit is contained in:
parent
564483e092
commit
1ae8869d7b
@ -9,6 +9,7 @@
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@ -3227,6 +3228,13 @@ mbus_str_xml_encode(u_char *dst, const u_char *src, size_t max_len)
|
||||
break;
|
||||
}
|
||||
|
||||
if (iscntrl(src[i]))
|
||||
{
|
||||
// convert all control chars into spaces
|
||||
dst[len++] = ' ';
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (src[i])
|
||||
{
|
||||
case '&':
|
||||
@ -3245,6 +3253,7 @@ mbus_str_xml_encode(u_char *dst, const u_char *src, size_t max_len)
|
||||
dst[len++] = src[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user