summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to 'testing')
-rw-r--r--testing/nTox.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/testing/nTox.c b/testing/nTox.c
index de37b6f7..b2ac6a71 100644
--- a/testing/nTox.c
+++ b/testing/nTox.c
@@ -10,6 +10,7 @@ void new_lines(char *line)
10 strcpy(lines[i],lines[i-1]); 10 strcpy(lines[i],lines[i-1]);
11 } 11 }
12 strcpy(lines[0],line); 12 strcpy(lines[0],line);
13 do_refresh();
13} 14}
14 15
15unsigned char * hex_string_to_bin(char hex_string[]) 16unsigned char * hex_string_to_bin(char hex_string[])
@@ -65,7 +66,7 @@ void line_eval(char lines[HISTORY][STRING_LENGTH], char *line)
65 strcat(command, line); 66 strcat(command, line);
66 new_lines(command); 67 new_lines(command);
67 } else { 68 } else {
68 new_lines(line); 69 //new_lines(line);
69 } 70 }
70} 71}
71 72
@@ -186,17 +187,22 @@ int main(int argc, char *argv[])
186 bootstrap_ip_port.port = htons(atoi(argv[2])); 187 bootstrap_ip_port.port = htons(atoi(argv[2]));
187 bootstrap_ip_port.ip.i = inet_addr(argv[1]); 188 bootstrap_ip_port.ip.i = inet_addr(argv[1]);
188 DHT_bootstrap(bootstrap_ip_port, hex_string_to_bin(argv[3])); 189 DHT_bootstrap(bootstrap_ip_port, hex_string_to_bin(argv[3]));
190 nodelay(stdscr, TRUE);
189 while(true) { 191 while(true) {
190 c=getch(); 192 c=getch();
191 if (c != 27) { 193 if (c != ERR) {
192 getmaxyx(stdscr,y,x); 194 if (c != 27) {
193 if (c == '\n') { 195 getmaxyx(stdscr,y,x);
194 line_eval(lines, line); 196 if (c == '\n') {
195 strcpy(line, ""); 197 line_eval(lines, line);
196 } else if (c == 127) { 198 strcpy(line, "");
197 line[strlen(line)-1] = '\0'; 199 } else if (c == 127) {
198 } else if (isalnum(c) || ispunct(c) || c == ' ') { 200 line[strlen(line)-1] = '\0';
199 strcpy(line,appender(line, (char) c)); 201 } else if (isalnum(c) || ispunct(c) || c == ' ') {
202 strcpy(line,appender(line, (char) c));
203 }
204 } else {
205 break;
200 } 206 }
201 } 207 }
202 doMessenger(); 208 doMessenger();