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 <assert.h>
|
||||||
|
#include <ctype.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -3227,6 +3228,13 @@ mbus_str_xml_encode(u_char *dst, const u_char *src, size_t max_len)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (iscntrl(src[i]))
|
||||||
|
{
|
||||||
|
// convert all control chars into spaces
|
||||||
|
dst[len++] = ' ';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
switch (src[i])
|
switch (src[i])
|
||||||
{
|
{
|
||||||
case '&':
|
case '&':
|
||||||
@ -3245,6 +3253,7 @@ mbus_str_xml_encode(u_char *dst, const u_char *src, size_t max_len)
|
|||||||
dst[len++] = src[i];
|
dst[len++] = src[i];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user