From f1f5b2a3bdc3178d57c4088a7cd7758afaeba9cb Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Thu, 2 Oct 2014 16:36:09 +0200 Subject: terminal: make utf8 decoder return length Lets return the parsed length in term_utf8_decode() instead of a buffer pointer. Store the pointer in the passed argument. This makes it adhere to the systemd coding-style, were we always avoid returning pointers, but store them in output arguments. In this case, the storage is not allocated, so it doesn't fit 100% to this idiom, but still looks much nicer. --- src/libsystemd-terminal/subterm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libsystemd-terminal/subterm.c') diff --git a/src/libsystemd-terminal/subterm.c b/src/libsystemd-terminal/subterm.c index 3990fb392b..adc4caa42e 100644 --- a/src/libsystemd-terminal/subterm.c +++ b/src/libsystemd-terminal/subterm.c @@ -716,10 +716,10 @@ static int terminal_io_fn(sd_event_source *source, int fd, uint32_t revents, voi for (i = 0; i < len; ++i) { const term_seq *seq; - const uint32_t *str; + uint32_t *str; size_t n_str, j; - str = term_utf8_decode(&t->utf8, &n_str, buf[i]); + n_str = term_utf8_decode(&t->utf8, &str, buf[i]); for (j = 0; j < n_str; ++j) { type = term_parser_feed(t->parser, &seq, str[j]); if (type < 0) { -- cgit v1.2.3-54-g00ecf