diff options
author | wm4 <wm4@nowhere> | 2013-12-30 22:49:11 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-12-30 22:49:51 +0100 |
commit | ec539dad2b8aeaaac75cfea6eac621530937227a (patch) | |
tree | 459c3a53a6fb911185db531346a937e73787fdb4 /common/common.c | |
parent | 7639e05ea80f565ff8fc3c7990e35da64be2ae02 (diff) | |
download | mpv-ec539dad2b8aeaaac75cfea6eac621530937227a.tar.bz2 mpv-ec539dad2b8aeaaac75cfea6eac621530937227a.tar.xz |
common: drop mp_append_utf8_buffer()
Diffstat (limited to 'common/common.c')
-rw-r--r-- | common/common.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/common/common.c b/common/common.c index 741dc236b9..e9cd70cf41 100644 --- a/common/common.c +++ b/common/common.c @@ -105,17 +105,8 @@ bool mp_rect_intersection(struct mp_rect *rc, const struct mp_rect *rc2) } // Encode the unicode codepoint as UTF-8, and append to the end of the -// talloc'ed buffer. -char *mp_append_utf8_buffer(char *buffer, uint32_t codepoint) -{ - char data[8]; - uint8_t tmp; - char *output = data; - PUT_UTF8(codepoint, tmp, *output++ = tmp;); - return talloc_strndup_append_buffer(buffer, data, output - data); -} - -// Like mp_append_utf8_buffer, but use bstr_xappend(). +// talloc'ed buffer. All guarantees bstr_xappend() give applies, such as +// implicit \0-termination for convenience. void mp_append_utf8_bstr(void *talloc_ctx, struct bstr *buf, uint32_t codepoint) { char data[8]; |