summaryrefslogtreecommitdiffstats
path: root/roff.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-04-20 19:40:13 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-04-20 19:40:13 +0000
commit846dd76f5940424c60690661ffd74602f74b5051 (patch)
tree010026608697be4b8db0f1a10b18a8f9fa9ef893 /roff.c
parentf45f622c8ebfa925e3b5340d31a0b4f9380ff675 (diff)
downloadmandoc-846dd76f5940424c60690661ffd74602f74b5051.tar.gz
make sure static buffers for snprintf(3) are large enough
and cast snprintf return value to (void) where they are
Diffstat (limited to 'roff.c')
-rw-r--r--roff.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/roff.c b/roff.c
index a8524d98..922b1908 100644
--- a/roff.c
+++ b/roff.c
@@ -488,7 +488,7 @@ roff_alloc(struct mparse *parse, int options)
static enum rofferr
roff_res(struct roff *r, char **bufp, size_t *szp, int ln, int pos)
{
- char ubuf[12]; /* buffer to print the number */
+ char ubuf[24]; /* buffer to print the number */
const char *start; /* start of the string to process */
const char *stesc; /* start of an escape sequence ('\\') */
const char *stnam; /* start of the name, after "[(*" */
@@ -614,11 +614,11 @@ roff_res(struct roff *r, char **bufp, size_t *szp, int ln, int pos)
ubuf[1] = '\0';
break;
case 'n':
- snprintf(ubuf, sizeof(ubuf), "%d",
+ (void)snprintf(ubuf, sizeof(ubuf), "%d",
roff_getregn(r, stnam, naml));
break;
case 'w':
- snprintf(ubuf, sizeof(ubuf), "%d",
+ (void)snprintf(ubuf, sizeof(ubuf), "%d",
24 * (int)naml);
break;
}