summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/main.c b/main.c
index e9368a4..0c321a0 100644
--- a/main.c
+++ b/main.c
@@ -317,7 +317,8 @@ void gfx_draw_post(GfxPost *post, int y, int x, int width) {
 
 	color_set(CPAIR_TIME, 0);
 	char *tstamp = ctime(&(time_t){post->src->timestamp.tv_sec});
-	mvaddnstr(y, x + width - strlen(tstamp) - 1, tstamp, strlen(tstamp) - 1);
+	tstamp[strlen(tstamp) - 1] = '\0'; /* remove trailing newline */
+	mvaddstr(y, x + width - strlen(tstamp), tstamp);
 
 	color_set(CPAIR_USER, 0);
 	mvaddnstr(y, x + 2, post->src->user.s, post->src->user.n);