enclose COLLECTION_NAME_MAX_LEN and HEADER_SIZE in parentheses

to prevent future potential issues.
This commit is contained in:
greenknot
2022-01-20 09:16:59 +01:00
parent 6d4d452ca6
commit 3c36c41d3e
3 changed files with 3 additions and 3 deletions

View File

@@ -6,7 +6,7 @@
// We defined the collection name max length to be the size of a `tokenDefinition_t` and remove the
// `ADDRESS_LENGTH` which corresponds to `sizeof(contractAddress`).
#define COLLECTION_NAME_MAX_LEN sizeof(tokenDefinition_t) - ADDRESS_LENGTH
#define COLLECTION_NAME_MAX_LEN (sizeof(tokenDefinition_t) - ADDRESS_LENGTH)
typedef struct nftInfo_t {
char collectionName[COLLECTION_NAME_MAX_LEN];

View File

@@ -9,7 +9,7 @@
#define TYPE_SIZE 1
#define VERSION_SIZE 1
#define NAME_LENGTH_SIZE 1
#define HEADER_SIZE TYPE_SIZE + VERSION_SIZE + NAME_LENGTH_SIZE
#define HEADER_SIZE (TYPE_SIZE + VERSION_SIZE + NAME_LENGTH_SIZE)
#define CHAIN_ID_SIZE 8
#define KEY_ID_SIZE 1

View File

@@ -18,7 +18,7 @@
#define ALGORITHM_ID_SIZE 1
#define SIGNATURE_LENGTH_SIZE 1
#define HEADER_SIZE TYPE_SIZE + VERSION_SIZE + PLUGIN_NAME_LENGTH_SIZE
#define HEADER_SIZE (TYPE_SIZE + VERSION_SIZE + PLUGIN_NAME_LENGTH_SIZE)
#define MIN_DER_SIG_SIZE 67
#define MAX_DER_SIG_SIZE 72