diff options
Diffstat (limited to 'usr.bin/mandoc/html.c')
-rw-r--r-- | usr.bin/mandoc/html.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.bin/mandoc/html.c b/usr.bin/mandoc/html.c index 219671ec597..47c59297012 100644 --- a/usr.bin/mandoc/html.c +++ b/usr.bin/mandoc/html.c @@ -1,4 +1,4 @@ -/* $OpenBSD: html.c,v 1.47 2014/10/26 17:11:18 schwarze Exp $ */ +/* $OpenBSD: html.c,v 1.48 2014/10/27 13:29:30 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org> @@ -455,11 +455,12 @@ print_encode(struct html *h, const char *p, int norecurse) break; case ESCAPE_SPECIAL: c = mchars_spec2cp(h->symtab, seq, len); - if (c > 0) + if (c <= 0) + break; + if (c < 0x20 || c > 0x7e) printf("&#%d;", c); - else if (-1 == c && 1 == len && - !print_escape(*seq)) - putchar((int)*seq); + else if ( ! print_escape(c)) + putchar(c); break; case ESCAPE_NOSPACE: if ('\0' == *p) |