summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/groff/pic
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-11-18 20:46:48 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-11-18 20:46:48 +0000
commit323c41ca9bc0986dc2a83bb659368c38dfaf02e1 (patch)
treea9b4c1916f2d76320f7726b8e120ced7f8a095f6 /gnu/usr.bin/groff/pic
parente14083d4ddfd218f41de29932814531200331787 (diff)
More printf format paranoia; noticed by David Krause
Diffstat (limited to 'gnu/usr.bin/groff/pic')
-rw-r--r--gnu/usr.bin/groff/pic/pic.y8
1 files changed, 5 insertions, 3 deletions
diff --git a/gnu/usr.bin/groff/pic/pic.y b/gnu/usr.bin/groff/pic/pic.y
index 4d5a35440d3..d0420acd793 100644
--- a/gnu/usr.bin/groff/pic/pic.y
+++ b/gnu/usr.bin/groff/pic/pic.y
@@ -1758,18 +1758,20 @@ char *do_sprintf(const char *form, const double *v, int nv)
if (*form == '%') {
one_format += *form++;
one_format += '\0';
- snprintf(sprintf_buf, sizeof(sprintf_buf), one_format.contents());
+ snprintf(sprintf_buf, sizeof(sprintf_buf),
+ "%s", one_format.contents());
}
else {
if (i >= nv) {
- lex_error("too few arguments to sprintf");
+ lex_error("too few arguments to snprintf");
result += one_format;
result += form;
break;
}
one_format += *form++;
one_format += '\0';
- snprintf(sprintf_buf, sizeof(sprintf_buf), one_format.contents(), v[i++]);
+ snprintf(sprintf_buf, sizeof(sprintf_buf),
+ one_format.contents(), v[i++]);
}
one_format.clear();
result += sprintf_buf;