diff options
-rw-r--r-- | testing/nTox.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/testing/nTox.c b/testing/nTox.c index 3aea6b32..52d1bfd1 100644 --- a/testing/nTox.c +++ b/testing/nTox.c | |||
@@ -343,19 +343,21 @@ void print_message(int friendnumber, uint8_t * string, uint16_t length) | |||
343 | void print_nickchange(int friendnumber, uint8_t *string, uint16_t length) | 343 | void print_nickchange(int friendnumber, uint8_t *string, uint16_t length) |
344 | { | 344 | { |
345 | char name[MAX_NAME_LENGTH]; | 345 | char name[MAX_NAME_LENGTH]; |
346 | getname(friendnumber, (uint8_t*)name); | 346 | if(getname(friendnumber, (uint8_t*)name) != -1) { |
347 | char msg[100+length]; | 347 | char msg[100+length]; |
348 | sprintf(msg, "[i] [%d] %s is now known as %s.", friendnumber, name, string); | 348 | sprintf(msg, "[i] [%d] %s is now known as %s.", friendnumber, name, string); |
349 | new_lines(msg); | 349 | new_lines(msg); |
350 | } | ||
350 | } | 351 | } |
351 | 352 | ||
352 | void print_statuschange(int friendnumber, uint8_t *string, uint16_t length) | 353 | void print_statuschange(int friendnumber, uint8_t *string, uint16_t length) |
353 | { | 354 | { |
354 | char name[MAX_NAME_LENGTH]; | 355 | char name[MAX_NAME_LENGTH]; |
355 | getname(friendnumber, (uint8_t*)name); | 356 | if(getname(friendnumber, (uint8_t*)name) != -1) { |
356 | char msg[100+length+strlen(name)+1]; | 357 | char msg[100+length+strlen(name)+1]; |
357 | sprintf(msg, "[i] [%d] %s's status changed to %s.", friendnumber, name, string); | 358 | sprintf(msg, "[i] [%d] %s's status changed to %s.", friendnumber, name, string); |
358 | new_lines(msg); | 359 | new_lines(msg); |
360 | } | ||
359 | } | 361 | } |
360 | 362 | ||
361 | void load_key(char *path) | 363 | void load_key(char *path) |