From b7a140a42f272aadb5400f013cd21a7a218d26e8 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Wed, 2 Oct 2024 13:55:08 -0600 Subject: wip validate, bitfield --- lib9p/9p.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib9p/9p.c') diff --git a/lib9p/9p.c b/lib9p/9p.c index e1303bd..af1c6ca 100644 --- a/lib9p/9p.c +++ b/lib9p/9p.c @@ -68,7 +68,7 @@ ssize_t lib9p_validate(struct lib9p_ctx *ctx, uint8_t *net_bytes) { return -1; assert(subctx.net_offset <= subctx.net_size); if (subctx.net_offset < subctx.net_size) - return lib9p_error(ctx, LINUX_EBADMSG, "message has %"PRIu32" extra bytes", + return lib9p_errorf(ctx, LINUX_EBADMSG, "message has %"PRIu32" extra bytes", subctx.net_size - subctx.net_offset); ssize_t ret; @@ -92,7 +92,7 @@ void lib9p_unmarshal(struct lib9p_ctx *ctx, uint8_t *net_bytes, /* Body */ struct _vtable_msg vtable = _lib9p_vtables[ctx->version].msgs[*ret_typ]; - subctx.extra = ret_body + vtable.unmarshal_basesize; + subctx.extra = ret_body + vtable.basesize; vtable.unmarshal(&subctx, ret_body); } -- cgit v1.2.3-2-g168b