diff --git a/src/chat.c b/src/chat.c index 9d6ce2e..3c39286 100644 --- a/src/chat.c +++ b/src/chat.c @@ -858,7 +858,7 @@ static void chat_onDraw(ToxWindow *self, Tox *m) } wattron(statusbar->topline, COLOR_PAIR(colour) | A_BOLD); - wprintw(statusbar->topline, " O"); + wprintw(statusbar->topline, " %s", ONLINE_CHAR); wattroff(statusbar->topline, COLOR_PAIR(colour) | A_BOLD); if (friends[self->num].is_typing) @@ -871,7 +871,7 @@ static void chat_onDraw(ToxWindow *self, Tox *m) if (friends[self->num].is_typing) wattroff(statusbar->topline, COLOR_PAIR(YELLOW)); } else { - wprintw(statusbar->topline, " o"); + wprintw(statusbar->topline, " %s", OFFLINE_CHAR); wattron(statusbar->topline, A_BOLD); wprintw(statusbar->topline, " %s ", statusbar->nick); wattroff(statusbar->topline, A_BOLD); diff --git a/src/friendlist.c b/src/friendlist.c index 569bc79..7dc69c8 100644 --- a/src/friendlist.c +++ b/src/friendlist.c @@ -447,7 +447,7 @@ static void friendlist_onDraw(ToxWindow *self, Tox *m) } wattron(self->window, COLOR_PAIR(colour) | A_BOLD); - wprintw(self->window, "O "); + wprintw(self->window, "%s ", ONLINE_CHAR); wattroff(self->window, COLOR_PAIR(colour) | A_BOLD); if (f_selected) @@ -487,7 +487,7 @@ static void friendlist_onDraw(ToxWindow *self, Tox *m) wprintw(self->window, "\n"); } else { - wprintw(self->window, "o "); + wprintw(self->window, "%s ", OFFLINE_CHAR); if (f_selected) wattron(self->window, COLOR_PAIR(BLUE)); diff --git a/src/prompt.c b/src/prompt.c index e6bbfc3..ae1eae8 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -302,7 +302,7 @@ static void prompt_onConnectionChange(ToxWindow *self, Tox *m, int32_t friendnum char timefrmt[TIME_STR_SIZE]; get_time_str(timefrmt, sizeof(timefrmt)); - char *msg; + const char *msg; if (status == 1) { msg = "has come online"; diff --git a/src/toxic.h b/src/toxic.h index fa5dc4a..314b89f 100644 --- a/src/toxic.h +++ b/src/toxic.h @@ -64,6 +64,9 @@ #define T_KEY_C_H 0x08 /* ctrl-h */ #define T_KEY_C_Y 0x19 /* ctrl-y */ +#define ONLINE_CHAR "*" +#define OFFLINE_CHAR "*" + typedef enum _FATAL_ERRS { FATALERR_MEMORY = -1, /* malloc() or calloc() failed */ FATALERR_FREAD = -2, /* fread() failed on critical read */ diff --git a/src/toxic_strings.c b/src/toxic_strings.c index b7eb880..033bbf6 100644 --- a/src/toxic_strings.c +++ b/src/toxic_strings.c @@ -111,7 +111,7 @@ int yank_buf(ChatContext *ctx) if (!ctx->yank[0]) return -1; - if (ctx->yank_len + ctx->len >= MAX_STR_SIZE - 1) + if (ctx->yank_len + ctx->len >= MAX_STR_SIZE) return -1; wmemmove(&ctx->line[ctx->pos + ctx->yank_len], &ctx->line[ctx->pos], ctx->len - ctx->pos);