diff options
-rw-r--r-- | main.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/main.c b/main.c index 0c321a0..93a3188 100644 --- a/main.c +++ b/main.c @@ -316,9 +316,8 @@ void gfx_draw_post(GfxPost *post, int y, int x, int width) { mvaddch(top, right, ACS_URCORNER); color_set(CPAIR_TIME, 0); - char *tstamp = ctime(&(time_t){post->src->timestamp.tv_sec}); - tstamp[strlen(tstamp) - 1] = '\0'; /* remove trailing newline */ - mvaddstr(y, x + width - strlen(tstamp), tstamp); + Str s = str_trim(str_from_cstr(ctime(&(time_t){post->src->timestamp.tv_sec}))); + mvaddnstr(y, x + width - s.n, s.s, s.n); color_set(CPAIR_USER, 0); mvaddnstr(y, x + 2, post->src->user.s, post->src->user.n); |