Skip to content

Commit

Permalink
write QR codes for addresses to file - cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
xtruan committed Mar 13, 2023
1 parent 99adebd commit 2aa66d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ App(
requires=[
"gui",
],
stack_size=2 * 1024,
stack_size=3 * 1024,
order=10,
fap_icon="flipbip_10px.png",
fap_icon_assets="icons",
Expand Down
13 changes: 7 additions & 6 deletions views/flipbip_scene_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ static int flipbip_scene_1_model_init(

// buffer for key serialization
const size_t buflen = 128;
char buf[128 + 1];
char buf[128 + 1] = {0};

// coin info
// bip44_coin, xprv_version, xpub_version, addr_version, wif_version, addr_format
Expand Down Expand Up @@ -452,12 +452,13 @@ static int flipbip_scene_1_model_init(
flipbip_scene_1_init_address(model->recv_addresses[a], node, coin_info[5], a);

// Save QR code file
char name[14] = {0};
strcpy(name, COIN_TEXT_ARRAY[coin][0]);
memzero(buf, buflen);
strcpy(buf, COIN_TEXT_ARRAY[coin][0]);
const unsigned char addr_num[1] = {a};
flipbip_btox(addr_num, 1, name + strlen(name));
strcpy(name + strlen(name), TEXT_QRFILE_EXT);
flipbip_save_qrfile(COIN_TEXT_ARRAY[coin][2], model->recv_addresses[a], name);
flipbip_btox(addr_num, 1, buf + strlen(buf));
strcpy(buf + strlen(buf), TEXT_QRFILE_EXT);
flipbip_save_qrfile(COIN_TEXT_ARRAY[coin][2], model->recv_addresses[a], buf);
memzero(buf, buflen);
}

model->page = PAGE_INFO;
Expand Down

0 comments on commit 2aa66d1

Please sign in to comment.