diff options
author | imp <imp@FreeBSD.org> | 1999-03-13 04:41:35 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 1999-03-13 04:41:35 +0000 |
commit | 60e55d5faa94e886588f2390f90b306d761e7bde (patch) | |
tree | a479f3393c77af6f8a87610c0de8363038ebe56a | |
parent | 67676551e8860e3651c1a3c55548ea54d90e2723 (diff) | |
download | FreeBSD-src-60e55d5faa94e886588f2390f90b306d761e7bde.zip FreeBSD-src-60e55d5faa94e886588f2390f90b306d761e7bde.tar.gz |
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.
-rw-r--r-- | usr.sbin/pccard/pccardc/printcis.c | 10 |
1 files changed, 8 insertions, 2 deletions
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 <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"); } /* |