From ad0b953fe85baf25181f21e9fab970f28c424e32 Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Wed, 15 Nov 2023 16:13:49 +0100 Subject: [PATCH] Fix incorrect assumption on max possible chain ID size --- src/shared_context.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/shared_context.h b/src/shared_context.h index f83320c..c87f286 100644 --- a/src/shared_context.h +++ b/src/shared_context.h @@ -176,14 +176,15 @@ typedef enum { #endif } contract_call_t; -#define NETWORK_STRING_MAX_SIZE 16 +// must be able to hold in decimal up to : floor(MAX_UINT64 / 2) - 36 +#define NETWORK_STRING_MAX_SIZE 19 typedef struct txStringProperties_s { char fullAddress[43]; char fullAmount[79]; // 2^256 is 78 digits long char maxFee[50]; char nonce[8]; // 10M tx per account ought to be enough for everybody - char network_name[NETWORK_STRING_MAX_SIZE]; + char network_name[NETWORK_STRING_MAX_SIZE + 1]; } txStringProperties_t; #ifdef TARGET_NANOS