buffer: remove useless buffer_add_xmlescaped()

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-04-08 18:08:44 +02:00
parent 7dbb02adf3
commit c95e73ee61
2 changed files with 0 additions and 40 deletions

View File

@ -114,40 +114,3 @@ buffer_detach(buffer_t *buf)
buffer_init(buf); buffer_init(buf);
return res; return res;
} }
/** Add a string to a buffer, escaping XML chars.
* \param buf Where to add data.
* \param s The string to add.
*/
void
buffer_add_xmlescaped(buffer_t *buf, const char *s)
{
for(;;)
{
int len = strcspn(s, "&<>'\"");
buffer_add(buf, s, len);
s += len;
switch (*s++)
{
case '\0':
return;
case '&':
buffer_adds(buf, "&amp;");
break;
case '<':
buffer_adds(buf, "&lt;");
break;
case '>':
buffer_adds(buf, "&gt;");
break;
case '\'':
/* OG: why not use default? */
buffer_adds(buf, "&#39;");
break;
case '"':
buffer_adds(buf, "&#34;");
break;
}
}
}

View File

@ -192,7 +192,4 @@ void buffer_addvf(buffer_t *buf, const char *fmt, va_list)
void buffer_addf(buffer_t *buf, const char *fmt, ...) void buffer_addf(buffer_t *buf, const char *fmt, ...)
__attribute__((format(printf, 2, 3))); __attribute__((format(printf, 2, 3)));
void buffer_add_xmlescaped(buffer_t *buf, const char *s);
#endif #endif