Skip to content

Commit

Permalink
C Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
coderofstuff committed May 17, 2023
1 parent 6406502 commit 9cd45c2
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/handler/sign_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ int handler_sign_tx(buffer_t *cdata, uint8_t type, bool more) {
G_context.req_type = CONFIRM_TRANSACTION;
G_context.state = STATE_NONE;

parser_status_e status = transaction_deserialize(cdata, &G_context.tx_info.transaction, G_context.bip32_path);
parser_status_e status =
transaction_deserialize(cdata, &G_context.tx_info.transaction, G_context.bip32_path);

PRINTF("Header Parsing status: %d.\n", status);

Expand Down
4 changes: 2 additions & 2 deletions src/transaction/deserialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ parser_status_e transaction_input_deserialize(buffer_t *buf, transaction_input_t
return buf->size - buf->offset == 0 ? PARSING_OK : INPUT_PARSING_ERROR;
}

parser_status_e transaction_deserialize(buffer_t *buf, transaction_t *tx, uint32_t* bip32_path) {
parser_status_e transaction_deserialize(buffer_t *buf, transaction_t *tx, uint32_t *bip32_path) {
uint8_t n_output = 0;
uint8_t n_input = 0;
uint8_t change_address_type = 0;
Expand All @@ -95,7 +95,7 @@ parser_status_e transaction_deserialize(buffer_t *buf, transaction_t *tx, uint32
if (tx->tx_output_len < 1 || tx->tx_output_len > 2) {
return OUTPUTS_LENGTH_PARSING_ERROR;
}

if (!buffer_read_u8(buf, &n_input)) {
return INPUTS_LENGTH_PARSING_ERROR;
}
Expand Down
4 changes: 2 additions & 2 deletions src/transaction/deserialize.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
* Pointer to transaction structure.
* @param[out] bip32_path
* Pointer to bip32_path array where change address info will be set
*
*
* @return PARSING_OK if success, error status otherwise.
*
*/
parser_status_e transaction_deserialize(buffer_t *buf, transaction_t *tx, uint32_t* bip32_path);
parser_status_e transaction_deserialize(buffer_t *buf, transaction_t *tx, uint32_t *bip32_path);

parser_status_e transaction_output_deserialize(buffer_t *buf, transaction_output_t *txout);

Expand Down
2 changes: 1 addition & 1 deletion src/transaction/serialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "../common/write.h"
#include "../common/varint.h"

int transaction_serialize(const transaction_t *tx, uint32_t* path, uint8_t *out, size_t out_len) {
int transaction_serialize(const transaction_t *tx, uint32_t *path, uint8_t *out, size_t out_len) {
size_t offset = 0;

if (out_len < 4) {
Expand Down
2 changes: 1 addition & 1 deletion src/transaction/serialize.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @return number of bytes written if success, -1 otherwise.
*
*/
int transaction_serialize(const transaction_t *tx, uint32_t* path, uint8_t *out, size_t out_len);
int transaction_serialize(const transaction_t *tx, uint32_t *path, uint8_t *out, size_t out_len);

/**
* Serialize transaction output in byte buffer.
Expand Down

0 comments on commit 9cd45c2

Please sign in to comment.