From 7ec97df3ee8edfd102fe573eaa61cf4e5c6284cb Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Fri, 27 Sep 2024 22:27:01 -0600 Subject: wip fixes --- lib9p/internal.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lib9p/internal.h') diff --git a/lib9p/internal.h b/lib9p/internal.h index ebdc3f3..a5175af 100644 --- a/lib9p/internal.h +++ b/lib9p/internal.h @@ -8,13 +8,15 @@ #define _LIB9P_INTERNAL_H_ #include -#include +#include /* for size_t */ +#include /* for SSIZE_MAX */ #include -#define USE_CONFIG_LIB9P +#define USE_CONFIG_9P #include "config.h" -static_assert(CONFIG_LIB9P_MAX_ERR_SIZE <= UINT16_MAX); +static_assert(CONFIG_9P_MAX_ERR_SIZE <= UINT16_MAX); +static_assert(CONFIG_9P_MAX_MSG_SIZE <= SSIZE_MAX); /* C language *****************************************************************/ @@ -34,7 +36,7 @@ struct lib9p_ctx { /* state */ uint32_t err_num; - char err_msg[CONFIG_LIB9P_MAX_ERR_SIZE]; + char err_msg[CONFIG_9P_MAX_ERR_SIZE]; }; /* vtables ********************************************************************/ @@ -42,7 +44,7 @@ struct lib9p_ctx { struct _checksize_ctx { struct lib9p_ctx *ctx; uint32_t net_size; - uint8_t net_bytes; + uint8_t *net_bytes; uint32_t net_offset; /* Increment `host_extra` to pre-allocate space that is @@ -52,6 +54,7 @@ struct _checksize_ctx { struct _unmarshal_ctx { struct lib9p_ctx *ctx; + uint8_t *net_bytes; uint32_t net_offset; /* `extra` points to the beginning of unallocated space. */ -- cgit v1.2.3-2-g168b