-/* $Id: chars.c,v 1.49 2011/07/22 14:15:15 kristaps Exp $ */
+/* $Id: chars.c,v 1.50 2011/07/31 11:24:39 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org>
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
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);