summaryrefslogtreecommitdiffstats
path: root/term_ps.c
diff options
context:
space:
mode:
authorJoerg Sonnenberger <joerg@netbsd.org>2014-01-05 19:10:56 +0000
committerJoerg Sonnenberger <joerg@netbsd.org>2014-01-05 19:10:56 +0000
commit5e614e747c24e529f84dbfb18721534f909128e9 (patch)
tree6b95f33544f611ed2bc6889a77a346526e7c4d0e /term_ps.c
parentbfc2a1a7b08ccfe41610d07abb12b2eca5139716 (diff)
downloadmandoc-5e614e747c24e529f84dbfb18721534f909128e9.tar.gz
Tag functions with format strings as arguments as printf-like.
Fix one case where a non-literal is used as format string. Fix another case where a variable is formatted using the wrong type.
Diffstat (limited to 'term_ps.c')
-rw-r--r--term_ps.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/term_ps.c b/term_ps.c
index 1c89e5c0..0a2e00b3 100644
--- a/term_ps.c
+++ b/term_ps.c
@@ -97,6 +97,9 @@ static void ps_growbuf(struct termp *, size_t);
static void ps_letter(struct termp *, int);
static void ps_pclose(struct termp *);
static void ps_pletter(struct termp *, int);
+#if __GNUC__ - 0 >= 4
+__attribute__((__format__ (__printf__, 2, 3)))
+#endif
static void ps_printf(struct termp *, const char *, ...);
static void ps_putchar(struct termp *, char);
static void ps_setfont(struct termp *, enum termfont);
@@ -824,7 +827,7 @@ ps_begin(struct termp *p)
ps_printf(p, "<<\n");
ps_printf(p, "/Type /Font\n");
ps_printf(p, "/Subtype /Type1\n");
- ps_printf(p, "/Name /F%zu\n", i);
+ ps_printf(p, "/Name /F%d\n", i);
ps_printf(p, "/BaseFont /%s\n", fonts[i].name);
ps_printf(p, ">>\n");
}