$NetBSD: patch-ad,v 1.2 2007/09/12 21:05:30 rillig Exp $

--- scsi.c.orig	2007-09-12 21:25:59.000000000 +0200
+++ scsi.c	2007-09-12 21:29:07.000000000 +0200
@@ -37,7 +37,7 @@
 #include <ctype.h>
 #include <string.h>
 #include <sys/scsiio.h>
-#include <sys/errno.h>
+#include <errno.h>
 #include <stdarg.h>
 #include <fcntl.h>
 
@@ -1044,7 +1044,7 @@ static void sense_7x_dump(FILE *f, scsir
 			fprintf(f, "Illegal value in the %s.\n",
 			(bad_par ? "parameter list" : "command descriptor block"));
 			byte = ((s[16] << 8) | s[17]);
-			value = bad_par ? (u_char)scsireq->databuf[byte] : (u_char)scsireq->cmd[byte];
+			value = ((u_char *)(bad_par ? scsireq->databuf : scsireq->cmd))[byte];
 			bit = s[15] & 0x7;
 			if (s[15] & 0x08)
 				fprintf(f, "Bit %d of byte %d (value %02x) is illegal.\n",
