summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--roff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/roff.c b/roff.c
index 17dd8457..5792eb86 100644
--- a/roff.c
+++ b/roff.c
@@ -1236,7 +1236,7 @@ deroff(char **dest, const struct roff_node *n)
/* Skip trailing backslash. */
sz = strlen(cp);
- if (cp[sz - 1] == '\\')
+ if (sz > 0 && cp[sz - 1] == '\\')
sz--;
/* Skip trailing whitespace. */