diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-05-15 22:29:50 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-05-15 22:29:50 +0000 |
commit | a96cac2f523bff3d1c811444fa013f8d9eca81c9 (patch) | |
tree | d505d7dd07408c0eb77d550214a76fd5bc283ea9 /chars.c | |
parent | d60df528affe8e1fa6467b843167b9697cb433ad (diff) | |
download | mandoc-a96cac2f523bff3d1c811444fa013f8d9eca81c9.tar.gz mandoc-a96cac2f523bff3d1c811444fa013f8d9eca81c9.tar.zst mandoc-a96cac2f523bff3d1c811444fa013f8d9eca81c9.zip |
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.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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 <kristaps@bsd.lv> * Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -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'); } |