Fri Dec 1 18:39:49 2017 UTC ()
Check format strings for ex_printf.


(rin)
diff -r1.5 -r1.6 src/external/bsd/nvi/dist/ex/ex_print.c

cvs diff -r1.5 -r1.6 src/external/bsd/nvi/dist/ex/ex_print.c (expand / switch to unified diff)

--- src/external/bsd/nvi/dist/ex/ex_print.c 2017/11/12 15:27:53 1.5
+++ src/external/bsd/nvi/dist/ex/ex_print.c 2017/12/01 18:39:49 1.6
@@ -1,32 +1,32 @@ @@ -1,32 +1,32 @@
1/* $NetBSD: ex_print.c,v 1.5 2017/11/12 15:27:53 rin Exp $ */ 1/* $NetBSD: ex_print.c,v 1.6 2017/12/01 18:39:49 rin Exp $ */
2/*- 2/*-
3 * Copyright (c) 1992, 1993, 1994 3 * Copyright (c) 1992, 1993, 1994
4 * The Regents of the University of California. All rights reserved. 4 * The Regents of the University of California. All rights reserved.
5 * Copyright (c) 1992, 1993, 1994, 1995, 1996 5 * Copyright (c) 1992, 1993, 1994, 1995, 1996
6 * Keith Bostic. All rights reserved. 6 * Keith Bostic. All rights reserved.
7 * 7 *
8 * See the LICENSE file for redistribution information. 8 * See the LICENSE file for redistribution information.
9 */ 9 */
10 10
11#include "config.h" 11#include "config.h"
12 12
13#include <sys/cdefs.h> 13#include <sys/cdefs.h>
14#if 0 14#if 0
15#ifndef lint 15#ifndef lint
16static const char sccsid[] = "Id: ex_print.c,v 10.24 2001/07/29 19:07:29 skimo Exp (Berkeley) Date: 2001/07/29 19:07:29 "; 16static const char sccsid[] = "Id: ex_print.c,v 10.24 2001/07/29 19:07:29 skimo Exp (Berkeley) Date: 2001/07/29 19:07:29 ";
17#endif /* not lint */ 17#endif /* not lint */
18#else 18#else
19__RCSID("$NetBSD: ex_print.c,v 1.5 2017/11/12 15:27:53 rin Exp $"); 19__RCSID("$NetBSD: ex_print.c,v 1.6 2017/12/01 18:39:49 rin Exp $");
20#endif 20#endif
21 21
22#include <sys/types.h> 22#include <sys/types.h>
23#include <sys/queue.h> 23#include <sys/queue.h>
24 24
25#include <bitstring.h> 25#include <bitstring.h>
26#include <ctype.h> 26#include <ctype.h>
27#include <limits.h> 27#include <limits.h>
28#include <stdio.h> 28#include <stdio.h>
29#include <string.h> 29#include <string.h>
30 30
31#ifdef __STDC__ 31#ifdef __STDC__
32#include <stdarg.h> 32#include <stdarg.h>
@@ -254,27 +254,27 @@ ex_prchars(SCR *sp, const CHAR_T *p, siz @@ -254,27 +254,27 @@ ex_prchars(SCR *sp, const CHAR_T *p, siz
254 "%c", repeatc ? repeatc : *kp); 254 "%c", repeatc ? repeatc : *kp);
255 if (INTERRUPTED(sp)) 255 if (INTERRUPTED(sp))
256 goto intr; 256 goto intr;
257 } 257 }
258 } 258 }
259intr: *colp = col; 259intr: *colp = col;
260 return (0); 260 return (0);
261} 261}
262 262
263/* 263/*
264 * ex_printf -- 264 * ex_printf --
265 * Ex's version of printf. 265 * Ex's version of printf.
266 * 266 *
267 * PUBLIC: int ex_printf __P((SCR *, const char *, ...)); 267 * PUBLIC: int ex_printf __P((SCR *, const char *, ...)) __printflike(2, 3);
268 */ 268 */
269int 269int
270#ifdef __STDC__ 270#ifdef __STDC__
271ex_printf(SCR *sp, const char *fmt, ...) 271ex_printf(SCR *sp, const char *fmt, ...)
272#else 272#else
273ex_printf(sp, fmt, va_alist) 273ex_printf(sp, fmt, va_alist)
274 SCR *sp; 274 SCR *sp;
275 const char *fmt; 275 const char *fmt;
276 va_dcl 276 va_dcl
277#endif 277#endif
278{ 278{
279 EX_PRIVATE *exp; 279 EX_PRIVATE *exp;
280 va_list ap; 280 va_list ap;