Skip to content

Commit 23cf367

Browse files
committed
review feedback: remove use of unused intermediate variable
1 parent be9b21d commit 23cf367

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

tools/keytools/sign.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,16 +1137,14 @@ static int make_header_ex(int is_diff, uint8_t *pubkey, uint32_t pubkey_sz,
11371137

11381138
/* Get the file size */
11391139
if (stat(CMD.cert_chain_file, &file_stat) == 0) {
1140-
cert_chain_sz = file_stat.st_size;
1141-
11421140
/* 2 bytes for tag + 2 bytes for length field */
11431141
const uint32_t tag_len_size = 4;
11441142
/* Maximum alignment padding that might be needed */
11451143
const uint32_t max_alignment = 8;
11461144
/* Required space = tag(2) + length(2) + data + potential alignment
11471145
* * padding */
11481146
const uint32_t required_space =
1149-
tag_len_size + cert_chain_sz + max_alignment;
1147+
tag_len_size + file_stat.st_size + max_alignment;
11501148

11511149
/* If the current header size is too small, increase it */
11521150
if (CMD.header_sz < required_space) {

0 commit comments

Comments
 (0)