From 096c40e3f39c59522fb06f159c4e9f1c31abfc25 Mon Sep 17 00:00:00 2001 From: Kris Kennaway Date: Fri, 25 May 2001 23:15:05 +0000 Subject: [PATCH] Mark error() as __printflike() and fix a non-exploitable format string error. MFC after: 1 week --- usr.bin/systat/extern.h | 2 +- usr.bin/systat/swap.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/systat/extern.h b/usr.bin/systat/extern.h index b3a01290522..81b660a7d0d 100644 --- a/usr.bin/systat/extern.h +++ b/usr.bin/systat/extern.h @@ -90,7 +90,7 @@ void die __P((int)); void display __P((int)); int dkinit __P((void)); int dkcmd __P((char *, char *)); -void error __P((const char *fmt, ...)); +void error __P((const char *fmt, ...)) __printflike(1, 2); void fetchicmp __P((void)); void fetchip __P((void)); void fetchiostat __P((void)); diff --git a/usr.bin/systat/swap.c b/usr.bin/systat/swap.c index f4b3267ed50..18aa0324ecb 100644 --- a/usr.bin/systat/swap.c +++ b/usr.bin/systat/swap.c @@ -101,7 +101,7 @@ initswap() if (kvm_getswapinfo(kd, &dummy, 1, 0) < 0) { snprintf(msgbuf, sizeof(msgbuf), "systat: kvm_getswapinfo failed"); - error(msgbuf); + error("%s", msgbuf); return (0); }