| 459 | } |
| 460 | |
| 461 | static void get_mnemonic(char *mnemonic) { |
| 462 | char *line = NULL; |
| 463 | size_t line_size = 0; |
| 464 | |
| 465 | printf("Introduce your BIP39 word list separated by space (at least 12 words):\n"); |
| 466 | fflush(stdout); |
| 467 | size_t characters = getline(&line, &line_size, stdin); |
| 468 | if (characters < 0) |
| 469 | errx(ERROR_USAGE, "Could not read line from stdin."); |
| 470 | line[characters-1] = '\0'; |
| 471 | strcpy(mnemonic, line); |
| 472 | free(line); |
| 473 | } |
| 474 | |
| 475 | static void read_mnemonic(char *mnemonic) { |
| 476 | /* Get words for the mnemonic language */ |