diff options
author | Jfreegman <Jfreegman@gmail.com> | 2013-07-31 17:36:04 -0400 |
---|---|---|
committer | Jfreegman <Jfreegman@gmail.com> | 2013-07-31 17:36:04 -0400 |
commit | 0ae9ec1815c82a9b0c0d5b116dcffe386a3ae218 (patch) | |
tree | d4d326193efd21f511eb259c9b9d258ac0b4e9e1 | |
parent | a448d39fd7ba10245e486b7fdf2f138ed2870510 (diff) |
partially fixed friend add bug (key length test still broken)
-rw-r--r-- | testing/nTox_win32.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/testing/nTox_win32.c b/testing/nTox_win32.c index b7b6a70d..bff6933b 100644 --- a/testing/nTox_win32.c +++ b/testing/nTox_win32.c | |||
@@ -126,8 +126,24 @@ void line_eval(char* line) | |||
126 | temp_id[i] = line[i+3]; | 126 | temp_id[i] = line[i+3]; |
127 | int num = m_addfriend(hex_string_to_bin(temp_id), (uint8_t*)"Install Gentoo", sizeof("Install Gentoo")); | 127 | int num = m_addfriend(hex_string_to_bin(temp_id), (uint8_t*)"Install Gentoo", sizeof("Install Gentoo")); |
128 | char numstring[100]; | 128 | char numstring[100]; |
129 | sprintf(numstring, "\n[i] added friend %d\n\n", num); | 129 | switch (num) { |
130 | printf(numstring); | 130 | case -1: |
131 | sprintf(numstring, "[i] Incorrect key length"); | ||
132 | break; | ||
133 | case -2: | ||
134 | sprintf(numstring, "[i] That appears to be your own key"); | ||
135 | break; | ||
136 | case -3: | ||
137 | sprintf(numstring, "[i] Friend request already sent"); | ||
138 | break; | ||
139 | case -4: | ||
140 | sprintf(numstring, "[i] Could not add friend"); | ||
141 | break; | ||
142 | default: | ||
143 | sprintf(numstring, "[i] Added friend %d", num); | ||
144 | printf(numstring); | ||
145 | break; | ||
146 | } | ||
131 | } | 147 | } |
132 | 148 | ||
133 | else if (inpt_command == 'r') { | 149 | else if (inpt_command == 'r') { |