diff --git a/common/buffer.c b/common/buffer.c index 2d20d32b..be0e5a12 100644 --- a/common/buffer.c +++ b/common/buffer.c @@ -114,40 +114,3 @@ buffer_detach(buffer_t *buf) buffer_init(buf); 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, "&"); - break; - case '<': - buffer_adds(buf, "<"); - break; - case '>': - buffer_adds(buf, ">"); - break; - case '\'': - /* OG: why not use default? */ - buffer_adds(buf, "'"); - break; - case '"': - buffer_adds(buf, """); - break; - } - } -} diff --git a/common/buffer.h b/common/buffer.h index 40732d34..45d627bc 100644 --- a/common/buffer.h +++ b/common/buffer.h @@ -192,7 +192,4 @@ void buffer_addvf(buffer_t *buf, const char *fmt, va_list) void buffer_addf(buffer_t *buf, const char *fmt, ...) __attribute__((format(printf, 2, 3))); - -void buffer_add_xmlescaped(buffer_t *buf, const char *s); - #endif