From 241aca98bdc8106221ee7d7dbcea9f2fa17f24bc Mon Sep 17 00:00:00 2001 From: Konstantin Kowalski Date: Fri, 26 Jul 2013 23:07:25 -0400 Subject: A *lot* of style changes. --- testing/nTox.c | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'testing/nTox.c') diff --git a/testing/nTox.c b/testing/nTox.c index 3a5e9bb3..27654191 100644 --- a/testing/nTox.c +++ b/testing/nTox.c @@ -39,9 +39,9 @@ int nick_before; void new_lines(char *line) { int i; - for (i = HISTORY-1; i > 0; i--) { + for (i = HISTORY-1; i > 0; i--) strcpy(lines[i],lines[i-1]); - } + strcpy(lines[0],line); do_refresh(); } @@ -53,8 +53,7 @@ unsigned char * hex_string_to_bin(char hex_string[]) unsigned char * val = malloc(len); char * pos = hex_string; int i=0; - while(i < len) - { + while(i < len) { sscanf(pos,"%2hhx",&val[i]); pos+=2; i++; @@ -71,17 +70,18 @@ void line_eval(char lines[HISTORY][STRING_LENGTH], char *line) if (line[1] == 'f') { // add friend command: /f ID int i; char temp_id[128]; - for (i=0; i<128; i++) { + for (i=0; i<128; i++) temp_id[i] = line[i+3]; - } int num = m_addfriend(hex_string_to_bin(temp_id), (uint8_t*)"Install Gentoo", sizeof("Install Gentoo")); char numstring[100]; sprintf(numstring, "[i] added friend %d", num); new_lines(numstring); do_refresh(); - } else if (line[1] == 'd') { + } + else if (line[1] == 'd') { doMessenger(); - } else if (line[1] == 'm') { //message command: /m friendnumber messsage + } + else if (line[1] == 'm') { //message command: /m friendnumber messsage int i; size_t len = strlen(line); char numstring[len-3]; @@ -91,15 +91,15 @@ void line_eval(char lines[HISTORY][STRING_LENGTH], char *line) numstring[i] = line[i+3]; } else { int j; - for (j=i+1; j