aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>1999-03-13 04:41:35 +0000
committerWarner Losh <imp@FreeBSD.org>1999-03-13 04:41:35 +0000
commitf229c04eef1f8be4448f67aece5abd856891731e (patch)
tree967a7a0705c87b8ba5155b5ce4c3f59713b152c3
parentef76b8c0572c90549c84bc5364f287bdabf72be8 (diff)
downloadsrc-f229c04eef1f8be4448f67aece5abd856891731e.tar.gz
src-f229c04eef1f8be4448f67aece5abd856891731e.zip
When printing out V1 info, make sure that there is additional info
before printing it. Terminate when we come to a 0xff byte. This allows there to be zero or more additional info fields printed correctly. Before, the old code would print bogons or dump core when presented with this case. I don't know what the spec says about this, exactly, but this allows me to do a dumpcis of my non-ATA AMP 4M FLASH cards w/o pccardc dumping core.
Notes
Notes: svn path=/head/; revision=44701
-rw-r--r--usr.sbin/pccard/pccardc/printcis.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.sbin/pccard/pccardc/printcis.c b/usr.sbin/pccard/pccardc/printcis.c
index 116d488c5614..ff5a15712684 100644
--- a/usr.sbin/pccard/pccardc/printcis.c
+++ b/usr.sbin/pccard/pccardc/printcis.c
@@ -26,7 +26,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: printcis.c,v 1.8 1997/10/06 11:35:55 charnier Exp $";
+ "$Id: printcis.c,v 1.9 1997/11/18 21:08:07 nate Exp $";
#endif /* not lint */
#include <stdio.h>
@@ -620,9 +620,15 @@ dump_info_v1(unsigned char *p, int len)
while (*p++);
printf("card vers = [%s]\n", p);
while (*p++);
+ if (*p == 0xff)
+ return;
printf("\tAddit. info = [%s]", p);
while (*p++);
- printf(",[%s]\n", p);
+ while (*p != 0xff) {
+ printf(",[%s]", p);
+ while (*p++);
+ }
+ printf("\n");
}
/*