Skip to content

Commit

Permalink
Fix -Wempty-body warning from clang
Browse files Browse the repository at this point in the history
clang recently grew a warning on `for (...);`. This patch
fixes all two instances of this pattern in libxml. The changes
don't modify the code semantic.
  • Loading branch information
nico authored and veillard committed Mar 5, 2012
1 parent 5cf1deb commit cedf84d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion pattern.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,8 @@ xmlNewPatParserContext(const xmlChar *pattern, xmlDictPtr dict,
cur->base = pattern;
if (namespaces != NULL) {
int i;
for (i = 0;namespaces[2 * i] != NULL;i++);
for (i = 0;namespaces[2 * i] != NULL;i++)
;
cur->nb_namespaces = i;
} else {
cur->nb_namespaces = 0;
Expand Down
9 changes: 5 additions & 4 deletions uri.c
Original file line number Diff line number Diff line change
Expand Up @@ -1604,10 +1604,11 @@ xmlNormalizeURIPath(char *path) {
break;
}
/* Valgrind complained, strcpy(cur, segp + 3); */
/* string will overlap, do not use strcpy */
tmp = cur;
segp += 3;
while ((*tmp++ = *segp++) != 0);
/* string will overlap, do not use strcpy */
tmp = cur;
segp += 3;
while ((*tmp++ = *segp++) != 0)
;

/* If there are no previous segments, then keep going from here. */
segp = cur;
Expand Down

0 comments on commit cedf84d

Please sign in to comment.