summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2006-05-11 07:13:18 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2006-05-11 07:13:18 +0000
commit5ad6ba1b564eb19787423b3b448634a26edc6393 (patch)
tree8aa0c6e73309d1f11b62228449eeac02673d1dfa
parentac1c987c0ea08f1db84e4314af6c260d11862c0c (diff)
need ctype.h for isprint.
%c expects an int argument, cast a u_long value so it gets it.
-rw-r--r--usr.bin/kdump/kdump.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c
index 29da3b3afc6..b40c632ad67 100644
--- a/usr.bin/kdump/kdump.c
+++ b/usr.bin/kdump/kdump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kdump.c,v 1.32 2006/05/11 06:52:04 tedu Exp $ */
+/* $OpenBSD: kdump.c,v 1.33 2006/05/11 07:13:17 tedu Exp $ */
/*-
* Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ static const char copyright[] =
#if 0
static char sccsid[] = "@(#)kdump.c 8.4 (Berkeley) 4/28/95";
#endif
-static const char rcsid[] = "$OpenBSD: kdump.c,v 1.32 2006/05/11 06:52:04 tedu Exp $";
+static const char rcsid[] = "$OpenBSD: kdump.c,v 1.33 2006/05/11 07:13:17 tedu Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -53,6 +53,7 @@ static const char rcsid[] = "$OpenBSD: kdump.c,v 1.32 2006/05/11 06:52:04 tedu E
#include <sys/errno.h>
#undef _KERNEL
+#include <ctype.h>
#include <err.h>
#include <signal.h>
#include <stdio.h>
@@ -347,8 +348,8 @@ ioctldecode(u_long cmd)
*dir++ = 'R';
*dir = '\0';
- printf(decimal ? ",_IO%s('%c',%ld" : ",_IO%s('%c',%#lx",
- dirbuf, (cmd >> 8) & 0xff, cmd & 0xff);
+ printf(decimal ? ",_IO%s('%c',%lu" : ",_IO%s('%c',%#lx",
+ dirbuf, (int)((cmd >> 8) & 0xff), cmd & 0xff);
if ((cmd & IOC_VOID) == 0)
printf(decimal ? ",%ld)" : ",%#lx)", (cmd >> 16) & 0xff);
else