=================================================================== RCS file: /cvs/mandoc/roff.c,v retrieving revision 1.289 retrieving revision 1.290 diff -u -p -r1.289 -r1.290 --- mandoc/roff.c 2017/02/17 03:03:03 1.289 +++ mandoc/roff.c 2017/03/03 11:50:49 1.290 @@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.289 2017/02/17 03:03:03 schwarze Exp $ */ +/* $Id: roff.c,v 1.290 2017/03/03 11:50:49 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons * Copyright (c) 2010-2015, 2017 Ingo Schwarze @@ -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. */