You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the file example.c, it is not possible to use the functionality "-e entropy_file", because the return of the function entropy_to_mnemonic is not well treated.
Indeed, according to the documentation of the function entropy_to_mnemonic in mnemonics.h, and according to this associated source code in mnemonics.c the function returns the
length of mnemonic phrase in characters or negative error code in case of failure
/* Converting entropy to a mnemonic phrase using the default dictionary. */
return_code = entropy_to_mnemonic(NULL, entropy, entropy_len, &mnemonic);
if (return_code != 0) {
printf("Error: Could not convert entropy.\n");
return;
}
This means that, if the entropy_to_mnemonic function returns the correct output (the length of the mnemonic phrase), then the program stops and prints that an error occurred.
One of the possible patch would be to change the error return check :
With the file example.c, it is not possible to use the functionality "-e entropy_file", because the return of the function entropy_to_mnemonic is not well treated.
Indeed, according to the documentation of the function entropy_to_mnemonic in mnemonics.h, and according to this associated source code in mnemonics.c the function returns the
However, in the example.c file, in the function convert_entropy_to_mnemonics, the variable
return_code
is compared to0
:This means that, if the entropy_to_mnemonic function returns the correct output (the length of the mnemonic phrase), then the program stops and prints that an error occurred.
One of the possible patch would be to change the error return check :
if (return_code != 0) {
by
if (return_code <= 0) {
in example.c
The text was updated successfully, but these errors were encountered: