From 60e55d5faa94e886588f2390f90b306d761e7bde Mon Sep 17 00:00:00 2001 From: imp Date: Sat, 13 Mar 1999 04:41:35 +0000 Subject: 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. --- usr.sbin/pccard/pccardc/printcis.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'usr.sbin/pccard') diff --git a/usr.sbin/pccard/pccardc/printcis.c b/usr.sbin/pccard/pccardc/printcis.c index 116d488..ff5a157 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 @@ -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"); } /* -- cgit v1.1