From 8eb2b2a2169af97e5182a5a758b09a6e0e0caf37 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Wed, 31 Aug 2011 14:57:45 -0700 Subject: Revised upb_bytesink, refactored upb_textprinter (untested). --- upb/bytestream.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'upb/bytestream.c') diff --git a/upb/bytestream.c b/upb/bytestream.c index 95ba064..09a1fb9 100644 --- a/upb/bytestream.c +++ b/upb/bytestream.c @@ -262,7 +262,7 @@ static int32_t upb_stringsink_vprintf(void *_s, const char *fmt, va_list args) { return ret; } -bool upb_stringsink_write(void *_s, const char *buf, size_t len) { +int upb_stringsink_write(void *_s, const void *buf, int len) { // TODO: detect realloc() errors. upb_stringsink *s = _s; if (s->len + len > s->size) { @@ -271,7 +271,7 @@ bool upb_stringsink_write(void *_s, const char *buf, size_t len) { } memcpy(s->str + s->len, buf, len); s->len += len; - return true; + return len; } void upb_stringsink_init(upb_stringsink *s) { -- cgit v1.2.3