summaryrefslogtreecommitdiff
path: root/upb/sink.c
diff options
context:
space:
mode:
Diffstat (limited to 'upb/sink.c')
-rw-r--r--upb/sink.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/upb/sink.c b/upb/sink.c
index e6ede49..d0197a6 100644
--- a/upb/sink.c
+++ b/upb/sink.c
@@ -4,9 +4,8 @@
bool upb_bufsrc_putbuf(const char *buf, size_t len, upb_bytessink *sink) {
void *subc;
bool ret;
- upb_bufhandle handle;
- upb_bufhandle_init(&handle);
- upb_bufhandle_setbuf(&handle, buf, 0);
+ upb_bufhandle handle = UPB_BUFHANDLE_INIT;
+ handle.buf = buf;
ret = upb_bytessink_start(sink, len, &subc);
if (ret && len != 0) {
ret = (upb_bytessink_putbuf(sink, subc, buf, len, &handle) >= len);
@@ -14,7 +13,6 @@ bool upb_bufsrc_putbuf(const char *buf, size_t len, upb_bytessink *sink) {
if (ret) {
ret = upb_bytessink_end(sink);
}
- upb_bufhandle_uninit(&handle);
return ret;
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback