Fix some code scanning issues.

This commit is contained in:
Michael R Sweet 2024-03-19 11:28:18 -04:00
parent 528c89ef86
commit 73c05c8b23
No known key found for this signature in database
GPG Key ID: BE67C75EC81F3244
3 changed files with 5 additions and 4 deletions

4
.github/codeql.yml vendored
View File

@ -1,5 +1,6 @@
paths-ignore:
- testsuite
- testmxml.c
query-filters:
- exclude:
@ -46,3 +47,6 @@ query-filters:
id: cpp/nested-loops-with-same-variable
- exclude:
id: cpp/stack-address-escape
- exclude:
id: cpp/world-writable-file-creation

View File

@ -556,7 +556,7 @@ mxmlSaveIO(
if (col > 0)
{
// Make sure the file ends with a newline...
if ((io_cb)(io_cbdata, "\n", 1) < 0)
if ((io_cb)(io_cbdata, "\n", 1) != 1)
return (false);
}
@ -914,8 +914,6 @@ mxml_getc(mxml_options_t *options, // I - Options
break;
}
// MXML_DEBUG("mxml_getc: %c (0x%04x)\n", ch < ' ' ? '.' : ch, ch);
if (mxml_bad_char(ch))
{
_mxml_error(options, "Bad control character 0x%02x not allowed by XML standard.", ch);

View File

@ -57,7 +57,6 @@ main(int argc, // I - Number of command-line args
*tree, // Element tree
*node; // Node which should be in test.xml
mxml_index_t *ind; // XML index
mxml_type_t type; // Node type
char buffer[16384]; // Save string
const char *text; // Text string
bool whitespace; // Whitespace before text string