summaryrefslogtreecommitdiffstats
path: root/chars.c
diff options
context:
space:
mode:
Diffstat (limited to 'chars.c')
-rw-r--r--chars.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/chars.c b/chars.c
index e4f3cbcf..e4f522b5 100644
--- a/chars.c
+++ b/chars.c
@@ -107,15 +107,13 @@ mchars_spec2cp(const struct mchars *arg, const char *p, size_t sz)
return(ln != NULL ? ln->unicode : sz == 1 ? (unsigned char)*p : -1);
}
-char
+int
mchars_num2char(const char *p, size_t sz)
{
int i;
- if ((i = mandoc_strntoi(p, sz, 10)) < 0)
- return('\0');
-
- return(i > 0 && i < 256 && isprint(i) ? i : '\0');
+ i = mandoc_strntoi(p, sz, 10);
+ return(i >= 0 && i < 256 ? i : -1);
}
int