* mdocml: Regression fixes after merging 1.11.3 to OpenBSD (rev.
@ 2011-07-31 11:24 schwarze
2011-07-31 11:31 ` Joerg Sonnenberger
0 siblings, 1 reply; 2+ messages in thread
From: schwarze @ 2011-07-31 11:24 UTC (permalink / raw)
To: source
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: mdocml: Regression fixes after merging 1.11.3 to OpenBSD (rev.
2011-07-31 11:24 mdocml: Regression fixes after merging 1.11.3 to OpenBSD (rev schwarze
@ 2011-07-31 11:31 ` Joerg Sonnenberger
0 siblings, 0 replies; 2+ messages in thread
From: Joerg Sonnenberger @ 2011-07-31 11:31 UTC (permalink / raw)
To: source
On Sun, Jul 31, 2011 at 07:24:39AM -0400, schwarze@mdocml.bsd.lv wrote:
> 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
Any reason why this doesn't use i>=0? That would allow the compiler to
merge both tests by using a bitmask...
Joerg
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-07-31 11:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-31 11:24 mdocml: Regression fixes after merging 1.11.3 to OpenBSD (rev schwarze
2011-07-31 11:31 ` Joerg Sonnenberger
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).