Skip to content

Commit

Permalink
Fixing typos.
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoccmartins committed Feb 4, 2025
1 parent c6562a9 commit 797bda4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
18 changes: 9 additions & 9 deletions src/common/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ bool adjustDecimals(const char *src,
}
target[offset++] = '0';
target[offset++] = '.';
for (uint32_t i = 0; i < delta; i++) {
for (uint32_t i = 0; i < delta; i++) {
target[offset++] = '0';
}
startOffset = offset;
for (uint32_t i = 0; i < srcLength; i++) {
for (uint32_t i = 0; i < srcLength; i++) {
target[offset++] = src[i];
}
target[offset] = '\0';
Expand All @@ -50,14 +50,14 @@ bool adjustDecimals(const char *src,
if (targetLength < srcLength + 1 + 1) {
return false;
}
while (offset < delta) {
while (offset < delta) {
target[offset++] = src[sourceOffset++];
}
if (decimals != 0) {
target[offset++] = '.';
}
startOffset = offset;
while (sourceOffset < srcLength) {
while (sourceOffset < srcLength) {
target[offset++] = src[sourceOffset++];
}
target[offset] = '\0';
Expand All @@ -71,7 +71,7 @@ bool adjustDecimals(const char *src,
lastZeroOffset = 0;
}
}
if (lastZeroOffset != 0) {
if (lastZeroOffset != 0) {
target[lastZeroOffset] = '\0';
if (target[lastZeroOffset - 1] == '.') {
target[lastZeroOffset - 1] = '\0';
Expand All @@ -86,7 +86,7 @@ unsigned short print_amount(uint64_t amount, char *out, uint32_t outlen, uint8_t
return 0;
}
out[0] = '0';
out[1] = '\0';
out[1] = '\0';

return strlen(out);
}
Expand All @@ -96,8 +96,8 @@ unsigned short print_amount(uint64_t amount, char *out, uint32_t outlen, uint8_t
uint32_t numDigits = 0, i;
uint64_t base = 1;

while (base <= amount) {
base *= 10;
while (base <= amount) {
base *= 10;
numDigits++;
}
if (numDigits > sizeof(tmp) - 2) {
Expand All @@ -110,7 +110,7 @@ unsigned short print_amount(uint64_t amount, char *out, uint32_t outlen, uint8_t
}
tmp[i] = '\0';
out[0] = '\0';
if ( adjustDecimals(tmp, i, tmp2, MAX_AMOUNT_STR_LEN, decimals) ) {
if (adjustDecimals(tmp, i, tmp2, MAX_AMOUNT_STR_LEN, decimals)) {
if (strlen(tmp2) < outlen - 1) {
strlcpy(out, tmp2, outlen);
}
Expand Down
8 changes: 4 additions & 4 deletions src/swap/handle_swap_sign_transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ static uint8_t* G_swap_sign_return_value_address;

/**
* Copies both the transaction parameters and address into a static location
* for posterior comparision against G_context, to avoid any injection attacks
* for posterior comparison against G_context, to avoid any injection attacks
* through the Exchange App.
*
* @param[in] create_transaction_parameters_t
* The transacttion parameters to be saved.
* The transaction parameters to be saved.
*
* @return true if success,false otherwise.
*
Expand All @@ -46,7 +46,7 @@ bool swap_copy_transaction_parameters(create_transaction_parameters_t* params) {
PRINTF("destination_address_extra_id memory not reserved\n");
return false;
} else if (params->destination_address_extra_id[0] != '\0') {
PRINTF("destination_address_extra_id is not empy: '%s'\n",
PRINTF("destination_address_extra_id is not empty: '%s'\n",
params->destination_address_extra_id);
return false;
}
Expand Down Expand Up @@ -154,7 +154,7 @@ static bool validate_swap_amount(uint64_t amount) {
bool swap_check_validity() {
PRINTF("Inside Aptos swap_check_validity\n");
if (!G_swap_validated.initialized) {
PRINTF("Swap Validated data not initalized.\n");
PRINTF("Swap Validated data not initialized.\n");
return false;
}
// Validate it's and actual coin transfer type
Expand Down

0 comments on commit 797bda4

Please sign in to comment.