diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-03-08 18:02:36 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-03-08 18:02:36 +0000 |
commit | 615c4124c25bfd89a89bc7b14e0fe58520858cb1 (patch) | |
tree | cee5dac9bdf6c58e909e7a2179e63627056fd4f6 /mdocterm.c | |
parent | 10f09076dfef711681072061a37b30e05dc2ba8e (diff) | |
download | mandoc-615c4124c25bfd89a89bc7b14e0fe58520858cb1.tar.gz |
Updated manuals.
Added -fign-scope and -fign-escape.
Diffstat (limited to 'mdocterm.c')
-rw-r--r-- | mdocterm.c | 27 |
1 files changed, 20 insertions, 7 deletions
@@ -681,24 +681,34 @@ pescape(struct termp *p, const char *word, size_t *i, size_t len) { size_t j; - (*i)++; - assert(*i < len); + if (++(*i) >= len) { + warnx("ignoring bad escape sequence"); + return; + } if ('(' == word[*i]) { (*i)++; - assert(*i + 1 < len); + if (*i + 1 >= len) { + warnx("ignoring bad escape sequence"); + return; + } nescape(p, &word[*i], 2); (*i)++; return; } else if ('*' == word[*i]) { - /* XXX - deprecated! */ (*i)++; - assert(*i < len); + if (*i >= len) { + warnx("ignoring bad escape sequence"); + return; + } switch (word[*i]) { case ('('): (*i)++; - assert(*i + 1 < len); + if (*i + 1 >= len) { + warnx("ignoring bad escape sequence"); + return; + } nescape(p, &word[*i], 2); (*i)++; return; @@ -718,7 +728,10 @@ pescape(struct termp *p, const char *word, size_t *i, size_t len) for (j = 0; word[*i] && ']' != word[*i]; (*i)++, j++) /* Loop... */ ; - assert(word[*i]); + if (0 == word[*i]) { + warnx("ignoring bad escape sequence"); + return; + } nescape(p, &word[*i - j], j); } |