source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Regression fixes after merging 1.11.3 to OpenBSD (rev.
Date: Sun, 31 Jul 2011 07:24:39 -0400 (EDT)	[thread overview]
Message-ID: <201107311124.p6VBOdOn017859@krisdoz.my.domain> (raw)

Log Message:
-----------
Regression fixes after merging 1.11.3 to OpenBSD (rev. 1.20):
* Do not pass integers outside the ASCII range to isprint().
* Make sure escaped characters are really printed verbatim
  when the escape sequence has no special meaning.
ok kristaps@

Modified Files:
--------------
    mdocml:
        chars.c

Revision Data
-------------
Index: chars.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/chars.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -Lchars.c -Lchars.c -u -p -r1.49 -r1.50
--- chars.c
+++ chars.c
@@ -113,7 +113,7 @@ mchars_num2char(const char *p, size_t sz
 
 	if ((i = mandoc_strntoi(p, sz, 10)) < 0)
 		return('\0');
-	return(isprint(i) ? i : '\0');
+	return(i > 0 && i < 256 && isprint(i) ? i : '\0');
 }
 
 int
@@ -133,8 +133,10 @@ mchars_spec2str(struct mchars *arg, cons
 	const struct ln	*ln;
 
 	ln = find(arg, p, sz);
-	if (NULL == ln)
+	if (NULL == ln) {
+		*rsz = 1;
 		return(NULL);
+	}
 
 	*rsz = strlen(ln->ascii);
 	return(ln->ascii);
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

             reply	other threads:[~2011-07-31 11:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-31 11:24 schwarze [this message]
2011-07-31 11:31 ` Joerg Sonnenberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201107311124.p6VBOdOn017859@krisdoz.my.domain \
    --to=schwarze@mdocml.bsd.lv \
    --cc=source@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).