Use separate printf()s instead of using a saved format string. Fixes

compiles with "FORMAT_AUDIT=yes WFORMAT=2".
This commit is contained in:
simonb 2001-02-15 02:32:26 +00:00
parent 32f6d71ea4
commit 785b754775
1 changed files with 6 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cmds.c,v 1.2 2001/02/15 01:59:54 simonb Exp $ */
/* $NetBSD: cmds.c,v 1.3 2001/02/15 02:32:26 simonb Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -66,7 +66,7 @@
#ifndef lint
#include <sys/cdefs.h>
__RCSID("$NetBSD: cmds.c,v 1.2 2001/02/15 01:59:54 simonb Exp $");
__RCSID("$NetBSD: cmds.c,v 1.3 2001/02/15 02:32:26 simonb Exp $");
#endif /* not lint */
#include <sys/types.h>
@ -118,7 +118,6 @@ struct {
static void
cmd_status0(struct mlx_disk *md)
{
const char *statusfmt;
int result;
result = md->hwunit;
@ -127,27 +126,25 @@ cmd_status0(struct mlx_disk *md)
switch(result) {
case MLX_SYSD_ONLINE:
statusfmt = "%s: online\n";
printf("%s: online\n", md->name);
break;
case MLX_SYSD_CRITICAL:
statusfmt = "%s: critical\n";
printf("%s: critical\n", md->name);
if (!rstatus)
rstatus = 1;
break;
case MLX_SYSD_OFFLINE:
statusfmt = "%s: offline\n";
printf("%s: offline\n", md->name);
rstatus = 2;
break;
default:
statusfmt = "%s: unknown status 0x%02x\n";
printf("%s: unknown status 0x%02x\n", md->name, result);
break;
}
printf(statusfmt, md->name, result);
/* Rebuild/check in progress on this drive? */
if (rs.rs_drive == md->hwunit &&
rs.rs_code != MLX_REBUILDSTAT_IDLE) {