diff --git a/chat.c b/chat.c index 32c05de..35be3bd 100644 --- a/chat.c +++ b/chat.c @@ -181,7 +181,7 @@ static void chat_onKey(ToxWindow *self, Messenger *m, int key) /* make sure the string has at least non-space character */ if (!string_is_empty(ctx->line)) { uint8_t selfname[MAX_NAME_LENGTH]; - getself_name(m, selfname); + getself_name(m, selfname, sizeof(selfname)); fix_name(selfname); wattron(ctx->history, COLOR_PAIR(2)); diff --git a/main.c b/main.c index 8ef4401..40ff5d0 100644 --- a/main.c +++ b/main.c @@ -140,7 +140,13 @@ static void init_tox() m_callback_namechange(m, on_nickchange, NULL); m_callback_statusmessage(m, on_statuschange, NULL); m_callback_action(m, on_action, NULL); - setname(m, (uint8_t*) "n00b", strlen("n00b")+1); +#ifdef __linux__ + setname(m, (uint8_t*) "Cool guy", sizeof("Cool guy")); +#elif WIN32 + setname(m, (uint8_t*) "I should install GNU/Linux", sizeof("I should install GNU/Linux")); +#else + setname(m, (uint8_t*) "Hipster", sizeof("Hipster")); +#endif } #define MAXLINE 90 /* Approx max number of chars in a sever line (IP + port + key) */