]> git.cameronkatri.com Git - mandoc.git/blobdiff - roff.c
Fix border condition in `tr' grokking arguments.
[mandoc.git] / roff.c
diff --git a/roff.c b/roff.c
index cfd4c876869099d8ff4eba86c129986f646afbf8..ac75b2a8ba6f5110625479a5282c4448780e9b05 100644 (file)
--- a/roff.c
+++ b/roff.c
@@ -1,4 +1,4 @@
-/*     $Id: roff.c,v 1.164 2011/07/28 14:17:11 kristaps Exp $ */
+/*     $Id: roff.c,v 1.165 2011/07/28 14:53:22 kristaps Exp $ */
 /*
  * Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -1383,10 +1383,11 @@ roff_tr(ROFF_ARGS)
                                return(ROFF_IGN);
                        }
                        ssz = (size_t)(p - second);
-               } else if ('\0' == *p) {
+               } else if ('\0' == *second) {
                        mandoc_msg(MANDOCERR_ARGCOUNT, r->parse, 
                                        ln, (int)(p - *bufp), NULL);
                        second = " ";
+                       p--;
                }
 
                roff_setstrn(&r->chrtab, first, fsz, second, ssz, 0);