mirror of
https://gitea.psi.ch/ELOG/mxml.git
synced 2026-09-09 01:23:22 +00:00
Changed assert to real test
This commit is contained in:
parent
5e10343edb
commit
4d4b4cf17b
5
mxml.cxx
5
mxml.cxx
@ -317,7 +317,10 @@ MXML_WRITER *mxml_open_file(const char *file_name)
|
||||
*/
|
||||
void mxml_encode(char* buf, int buf_size, const char *src, int src_len, int translate)
|
||||
{
|
||||
assert(buf_size > 6*src_len); // each input byte is expanded into 6 bytes at most
|
||||
if (buf_size <= 6*src_len) {
|
||||
printf("mxml_encode: buffer size too small\n");
|
||||
exit(0);
|
||||
}
|
||||
char *pd = buf;
|
||||
const char* ps;
|
||||
for (ps = src ; *ps ; ps++) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user