Mercurial > pidgin
diff libpurple/xmlnode.c @ 28726:f6f35d5960e9
Use g_strndup() for great justice.
| author | Paul Aurich <paul@darkrain42.org> |
|---|---|
| date | Tue, 01 Dec 2009 02:54:22 +0000 |
| parents | f1437342cc0e |
| children | 981374c7308b |
line wrap: on
line diff
--- a/libpurple/xmlnode.c Mon Nov 30 15:46:58 2009 +0000 +++ b/libpurple/xmlnode.c Tue Dec 01 02:54:22 2009 +0000 @@ -588,9 +588,7 @@ const char *prefix = (const char *)attributes[i+1]; char *txt; int attrib_len = attributes[i+4] - attributes[i+3]; - char *attrib = g_malloc(attrib_len + 1); - memcpy(attrib, attributes[i+3], attrib_len); - attrib[attrib_len] = '\0'; + char *attrib = g_strndup(attributes[i+3], attrib_len); txt = attrib; attrib = purple_unescape_html(txt); g_free(txt);
