diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2019-01-12 16:15:46 -0800 |
---|---|---|
committer | Joshua Haberman <jhaberman@gmail.com> | 2019-01-12 16:15:46 -0800 |
commit | d2f9bec5c6f3c34362cf13e35e11d3dbc7888a32 (patch) | |
tree | 7a2d1f3e34ea5ad6486cbb56da8b6ed49a123690 /upb/sink.c | |
parent | 0553eff64a87eceff0de3b6260b4f2d45b61703a (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.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -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; } |