summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testing/misc_tools.c1
-rw-r--r--testing/nTox.c8
2 files changed, 7 insertions, 2 deletions
diff --git a/testing/misc_tools.c b/testing/misc_tools.c
index dbaa8b3b..aa546a88 100644
--- a/testing/misc_tools.c
+++ b/testing/misc_tools.c
@@ -36,5 +36,6 @@ unsigned char * hex_string_to_bin(char hex_string[])
36 int i; 36 int i;
37 for(i = 0; i < len; ++i, pos+=2) 37 for(i = 0; i < len; ++i, pos+=2)
38 sscanf(pos,"%2hhx",&val[i]); 38 sscanf(pos,"%2hhx",&val[i]);
39
39 return val; 40 return val;
40} 41}
diff --git a/testing/nTox.c b/testing/nTox.c
index 15e209a9..9a07ecdc 100644
--- a/testing/nTox.c
+++ b/testing/nTox.c
@@ -142,7 +142,9 @@ void line_eval(char *line)
142 for (i = 0; i < 128; i++) 142 for (i = 0; i < 128; i++)
143 temp_id[i] = line[i+prompt_offset]; 143 temp_id[i] = line[i+prompt_offset];
144 144
145 int num = m_addfriend(hex_string_to_bin(temp_id), (uint8_t*)"Install Gentoo", sizeof("Install Gentoo")); 145 unsigned char *bin_string = hex_string_to_bin(temp_id);
146 int num = m_addfriend(bin_string, (uint8_t*)"Install Gentoo", sizeof("Install Gentoo"));
147 free(bin_string);
146 char numstring[100]; 148 char numstring[100];
147 switch (num) { 149 switch (num) {
148 case -1: 150 case -1:
@@ -456,7 +458,9 @@ int main(int argc, char *argv[])
456 else 458 else
457 exit(1); 459 exit(1);
458 460
459 DHT_bootstrap(bootstrap_ip_port, hex_string_to_bin(argv[3])); 461 unsigned char *binary_string = hex_string_to_bin(argv[3]);
462 DHT_bootstrap(bootstrap_ip_port, binary_string);
463 free(binary_string);
460 nodelay(stdscr, TRUE); 464 nodelay(stdscr, TRUE);
461 while(true) { 465 while(true) {
462 if (on == 0 && DHT_isconnected()) { 466 if (on == 0 && DHT_isconnected()) {