diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2019-03-26 10:37:37 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-26 10:37:37 -0700 |
commit | e999afb61255179d563375e2748a02c036e927e3 (patch) | |
tree | 0278856cbd0263bdddd2f0c68259d3ec2ea383d5 /upb/decode.c | |
parent | a8a0bc73b981bd94509c180ad8cac36143c479ec (diff) | |
parent | 0abf6083b33b13bea895bf5d885c5ec58b2bd986 (diff) |
Merge pull request #150 from haberman/apitweaks
A few small API tweaks.
Diffstat (limited to 'upb/decode.c')
-rw-r--r-- | upb/decode.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/upb/decode.c b/upb/decode.c index f43f18f..8ea0573 100644 --- a/upb/decode.c +++ b/upb/decode.c @@ -585,11 +585,12 @@ static bool upb_decode_message(upb_decstate *d, const char *limit, return true; } -bool upb_decode(upb_strview buf, void *msg, const upb_msglayout *l) { +bool upb_decode(const char *buf, size_t size, void *msg, + const upb_msglayout *l) { upb_decstate state; - state.ptr = buf.data; + state.ptr = buf; - return upb_decode_message(&state, buf.data + buf.size, 0, msg, l); + return upb_decode_message(&state, buf + size, 0, msg, l); } #undef CHK |