Skip to content

Commit

Permalink
Fix some code scanning issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Mar 19, 2024
1 parent 528c89e commit 73c05c8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
paths-ignore:
- testsuite
- testmxml.c

query-filters:
- exclude:
Expand Down Expand Up @@ -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

4 changes: 1 addition & 3 deletions mxml-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion testmxml.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 73c05c8

Please sign in to comment.