about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--mshow.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mshow.c b/mshow.c
index 66ccb97..c431108 100644
--- a/mshow.c
+++ b/mshow.c
@@ -270,7 +270,7 @@ nofilter:
 			    strcasecmp(charset, "utf8") == 0 ||
 			    strcasecmp(charset, "us-ascii") == 0) {
 				print_ascii(body, bodylen);
-				if (body[bodylen-1] != '\n')
+				if (bodylen > 0 && body[bodylen-1] != '\n')
 					putchar('\n');
 			} else {
 				print_u8recode(body, bodylen, charset);