diff options
author | Patrick Reynolds <cpreynolds@gmail.com> | 2010-07-01 18:45:24 -0400 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2010-07-11 14:25:20 +0200 |
commit | dd509097513d17ad74013df2c5a037b1b1b48173 (patch) | |
tree | db8055c39f4afa20e45b9c6609815f725e132409 /libezxml/src/ezxml.c | |
parent | 3631791ee6431abf3dfec7db698f2a2778a867c3 (diff) | |
download | pianobar-windows-dd509097513d17ad74013df2c5a037b1b1b48173.tar.gz pianobar-windows-dd509097513d17ad74013df2c5a037b1b1b48173.tar.bz2 pianobar-windows-dd509097513d17ad74013df2c5a037b1b1b48173.zip |
Fixing a warning in ezxml.
Assignment as used in the prefix ++ results in undefined behavior when the
variable is used in a function call later in the while loop condition. Most of
the time this works, but the behavior is technically undefined.
Diffstat (limited to 'libezxml/src/ezxml.c')
-rw-r--r-- | libezxml/src/ezxml.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libezxml/src/ezxml.c b/libezxml/src/ezxml.c index 52deb95..967d535 100644 --- a/libezxml/src/ezxml.c +++ b/libezxml/src/ezxml.c @@ -426,7 +426,8 @@ static short ezxml_internal_dtd(ezxml_root_t root, char *s, size_t len) else *s = '\0'; // null terminate tag name for (i = 0; root->attr[i] && strcmp(n, root->attr[i][0]); i++); - while (*(n = ++s + strspn(s, EZXML_WS)) && *n != '>') { + ++s; // ansi cpr + while (*(n = s + strspn(s, EZXML_WS)) && *n != '>') { if (*(s = n + strcspn(n, EZXML_WS))) *s = '\0'; // attr name else { ezxml_err(root, t, "malformed <!ATTLIST"); break; } @@ -467,6 +468,7 @@ static short ezxml_internal_dtd(ezxml_root_t root, char *s, size_t len) root->attr[i][j + 1] = (v) ? ezxml_decode(v, root->ent, *c) : NULL; root->attr[i][j] = n; // attribute name + ++s; } } else if (! strncmp(s, "<!--", 4)) s = strstr(s + 4, "-->"); // comments |