summaryrefslogtreecommitdiff
path: root/upb/sink.c
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2019-01-12 16:15:46 -0800
committerJoshua Haberman <jhaberman@gmail.com>2019-01-12 16:15:46 -0800
commitd2f9bec5c6f3c34362cf13e35e11d3dbc7888a32 (patch)
tree7a2d1f3e34ea5ad6486cbb56da8b6ed49a123690 /upb/sink.c
parent0553eff64a87eceff0de3b6260b4f2d45b61703a (diff)
Removed old-style C++ handlers that relied on UB in favor of more normal ones.
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