Check error pointer

This commit is contained in:
2012-02-03 15:50:14 +00:00
parent 9fe5b85a7f
commit d8cffaed40
+4 -2
View File
@@ -1274,13 +1274,15 @@ PMXML_NODE read_error(PMXML_NODE root, const char *file_name, int line_number, c
else
sprintf(str, "XML read error, line %d: ", line_number);
msg = (char *)mxml_malloc(error_size);
strlcpy(error, str, error_size);
if (error)
strlcpy(error, str, error_size);
va_start(argptr, format);
vsprintf(str, (char *) format, argptr);
va_end(argptr);
strlcat(error, str, error_size);
if (error)
strlcat(error, str, error_size);
if (error_line)
*error_line = line_number;