diff --git a/src/chat.c b/src/chat.c index c404a1e..a62b94e 100644 --- a/src/chat.c +++ b/src/chat.c @@ -547,9 +547,9 @@ static void chat_onDraw(ToxWindow *self, Tox *m) self->x = x2; /* Truncate note if it doesn't fit in statusbar */ - uint16_t maxlen = x2 - getcurx(statusbar->topline) - (KEY_IDENT_DIGITS * 2) - 6; + uint16_t maxlen = x2 - getcurx(statusbar->topline) - (KEY_IDENT_DIGITS * 2) - 7; if (statusbar->statusmsg_len > maxlen) { - statusbar->statusmsg[maxlen-1] = '\0'; + statusbar->statusmsg[maxlen] = '\0'; statusbar->statusmsg_len = maxlen; } diff --git a/src/friendlist.h b/src/friendlist.h index 0dd4a8f..029c9a6 100644 --- a/src/friendlist.h +++ b/src/friendlist.h @@ -3,8 +3,6 @@ #include "toxic_windows.h" -#define KEY_IDENT_DIGITS 2 - typedef struct { uint8_t name[TOX_MAX_NAME_LENGTH]; uint16_t namelength; diff --git a/src/toxic_windows.h b/src/toxic_windows.h index ae126db..774b790 100644 --- a/src/toxic_windows.h +++ b/src/toxic_windows.h @@ -26,6 +26,7 @@ #define N_DEFAULT_WINS 2 /* number of permanent default windows */ #define CURS_Y_OFFSET 3 /* y-axis cursor offset for chat contexts */ #define CHATBOX_HEIGHT 4 +#define KEY_IDENT_DIGITS 2 /* number of hex digits to display for the pub-key based identifier */ #define EXIT_SUCCESS 0 #define EXIT_FAILURE 1