summaryrefslogtreecommitdiffstats
path: root/chars.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-05-15 22:29:50 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-05-15 22:29:50 +0000
commitc70f3a05441e12c7acc42ed18bde164df21a9e75 (patch)
tree303d7d369e23462c2b1d31e16d78f1e94e45c789 /chars.c
parentde205044ce0e8b0414ab85bbd5e600391fe34e98 (diff)
downloadmandoc-c70f3a05441e12c7acc42ed18bde164df21a9e75.tar.gz
Remove function calls to res() and so forth in term_word(). These were
only used once and simply bloated the binary. Also fix mchars_num2char to correctly render the character instead of using atoi(). This makes the conversation more strict, but it's more correct.
Diffstat (limited to 'chars.c')
-rw-r--r--chars.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/chars.c b/chars.c
index 72da5103..37bb9a97 100644
--- a/chars.c
+++ b/chars.c
@@ -26,6 +26,7 @@
#include <string.h>
#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');
}