@@ -786,7 +786,7 @@ struct WordListState {
786786 free (wordndx);
787787 }
788788
789- virtual char const * refword (int ndx) = 0;
789+ virtual String refword (int ndx) = 0;
790790
791791 void set_words (uint16_t const * wordlist) {
792792 for (int ii = 0 ; ii < nwords; ++ii)
@@ -829,7 +829,7 @@ struct WordListState {
829829 }
830830
831831 void cursor_right () {
832- if (pos < (int )strlen ( refword (wordndx[selected])) - 1 )
832+ if (pos < (int )refword (wordndx[selected]). length ( ) - 1 )
833833 ++pos;
834834 }
835835
@@ -868,7 +868,7 @@ struct WordListState {
868868 }
869869
870870 String prefix (int word) {
871- return String ( refword (word) ).substring (0 , pos);
871+ return refword (word).substring (0 , pos);
872872 }
873873
874874 char current (int word) {
@@ -890,8 +890,8 @@ struct WordListState {
890890
891891struct SLIP39WordlistState : WordListState {
892892 SLIP39WordlistState (int i_nwords) : WordListState(i_nwords, 1024 ) {}
893- virtual char const * refword (int ndx) {
894- return slip39_string_for_word (ndx);
893+ virtual String refword (int ndx) {
894+ return String ( slip39_string_for_word (ndx) );
895895 }
896896};
897897
@@ -901,8 +901,8 @@ struct BIP39WordlistState : WordListState {
901901 : WordListState(i_nwords, 2048 )
902902 , bip39(i_bip39)
903903 {}
904- virtual char const * refword (int ndx) {
905- return BIP39Seq::get_dict_string (ndx). c_str () ;
904+ virtual String refword (int ndx) {
905+ return BIP39Seq::get_dict_string (ndx);
906906 }
907907};
908908
@@ -935,7 +935,7 @@ void restore_bip39() {
935935
936936 for (int rr = 0 ; rr < state.nrows ; ++rr) {
937937 int wndx = state.scroll + rr;
938- String word = String ( state.refword (state.wordndx [wndx]) );
938+ String word = state.refword (state.wordndx [wndx]);
939939 Serial.println (String (wndx) + " " + word);
940940
941941 if (wndx != state.selected ) {
@@ -1256,7 +1256,7 @@ void enter_share() {
12561256
12571257 for (int rr = 0 ; rr < state.nrows ; ++rr) {
12581258 int wndx = state.scroll + rr;
1259- String word = String ( state.refword (state.wordndx [wndx]) );
1259+ String word = state.refword (state.wordndx [wndx]);
12601260 Serial.println (String (wndx) + " " + word);
12611261
12621262 if (wndx != state.selected ) {
0 commit comments