X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/d60df528affe8e1fa6467b843167b9697cb433ad..a96cac2f523bff3d1c811444fa013f8d9eca81c9:/chars.c?ds=inline diff --git a/chars.c b/chars.c index 41b02e34..06a2a923 100644 --- a/chars.c +++ b/chars.c @@ -1,4 +1,4 @@ -/* $Id: chars.c,v 1.42 2011/05/15 15:47:46 kristaps Exp $ */ +/* $Id: chars.c,v 1.43 2011/05/15 22:29:50 kristaps Exp $ */ /* * Copyright (c) 2009, 2010 Kristaps Dzonsons * Copyright (c) 2011 Ingo Schwarze @@ -26,6 +26,7 @@ #include #include "mandoc.h" +#include "libmandoc.h" #define PRINT_HI 126 #define PRINT_LO 32 @@ -148,11 +149,9 @@ mchars_num2char(const char *p, size_t sz) { int i; - if (sz > 3) + if ((i = mandoc_strntou(p, sz, 10)) < 0) return('\0'); - i = atoi(p); - /* LINTED */ return(isprint(i) ? i : '\0'); }