diff options
Diffstat (limited to 'lib9p/types.c')
-rw-r--r-- | lib9p/types.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib9p/types.c b/lib9p/types.c index 8a48b85..0c03bd5 100644 --- a/lib9p/types.c +++ b/lib9p/types.c @@ -24,7 +24,7 @@ const char *lib9p_version_str(enum lib9p_version ver) { return version_strs[ver]; } -static const char *msg_type_strs[0xFF] = { +static const char *msg_type_strs[0x100] = { [0x00] = "0x00", [0x01] = "0x01", [0x02] = "0x02", @@ -917,9 +917,6 @@ static bool marshal_Rattach(struct _marshal_ctx *ctx, struct lib9p_msg_Rattach * } static bool marshal_Rerror(struct _marshal_ctx *ctx, struct lib9p_msg_Rerror *val) { - /* Truncate the error-string if necessary to avoid returning ERANGE. */ - if (((uint32_t)val->ename.len) + ctx->ctx->Rerror_overhead > ctx->ctx->max_msg_size) - val->ename.len = ctx->ctx->max_msg_size - ctx->ctx->Rerror_overhead; return marshal_s(ctx, &val->ename) || ( (ctx->ctx->version==LIB9P_VER_9P2000_u) && marshal_4(ctx, &val->errno) ); } |