Fix one case where a non-literal is used as format string.
authorschwarze <schwarze@openbsd.org>
Sun, 5 Jan 2014 21:21:08 +0000 (21:21 +0000)
committerschwarze <schwarze@openbsd.org>
Sun, 5 Jan 2014 21:21:08 +0000 (21:21 +0000)
Fix another case where a variable is formatted using the wrong type.
Patch from Joerg Sonnenberger <joerg@NetBSD>.

usr.bin/mandoc/html.c
usr.bin/mandoc/term_ps.c

index f35df30..5b080a4 100644 (file)
@@ -1,4 +1,4 @@
-/*     $Id: html.c,v 1.31 2013/08/08 20:07:24 schwarze Exp $ */
+/*     $Id: html.c,v 1.32 2014/01/05 21:21:08 schwarze Exp $ */
 /*
  * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2011, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org>
@@ -718,7 +718,7 @@ buffmt_man(struct html *h,
                        bufcat(h, sec ? sec : "1");
                        break;
                case('N'):
-                       bufcat_fmt(h, name);
+                       bufcat_fmt(h, "%s", name);
                        break;
                default:
                        bufncat(h, p, 2);
index bba7704..2fd0ee7 100644 (file)
@@ -1,4 +1,4 @@
-/*     $Id: term_ps.c,v 1.19 2011/10/16 12:18:32 schwarze Exp $ */
+/*     $Id: term_ps.c,v 1.20 2014/01/05 21:21:08 schwarze Exp $ */
 /*
  * Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
  *
@@ -824,7 +824,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");
                }