summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorbms <bms@FreeBSD.org>2005-01-21 16:15:24 +0000
committerbms <bms@FreeBSD.org>2005-01-21 16:15:24 +0000
commit9dbf507683533da781974454fb6a14e52c9ba92e (patch)
treeebed4f9bbf25552be7f2c040af3a571bc1e7d96a /tools
parent33e44ca5a9c0f843c3465f3efc2b14f7740be716 (diff)
downloadFreeBSD-src-9dbf507683533da781974454fb6a14e52c9ba92e.zip
FreeBSD-src-9dbf507683533da781974454fb6a14e52c9ba92e.tar.gz
Do not treat an invalid PIR table checksum as a fatal error condition, but
do print a warning about it. Correct a stupid logic error. Update copyrights. Fix whitespace bug. MFC after: 1 week
Diffstat (limited to 'tools')
-rw-r--r--tools/tools/pirtool/pirtool.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/tools/pirtool/pirtool.c b/tools/tools/pirtool/pirtool.c
index 047a721..4207e08 100644
--- a/tools/tools/pirtool/pirtool.c
+++ b/tools/tools/pirtool/pirtool.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002-2004 Bruce M. Simpson.
+ * Copyright (c) 2002-2005 Bruce M. Simpson.
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
@@ -101,7 +101,7 @@ main(int argc, char *argv[])
/*
* Find and print the PIR table.
*/
- if ((pir = find_pir_table(map_addr)) != NULL) {
+ if ((pir = find_pir_table(map_addr)) == NULL) {
fprintf(stderr, "PIR table signature not found.\r\n");
} else {
dump_pir_table(pir, map_addr);
@@ -152,7 +152,7 @@ find_pir_table(unsigned char *base)
pend = base + PIR_SIZE;
for (p = base; p < pend; p += 16) {
if (strncmp(p, "$PIR", 4) == 0) {
- pir = (pir_table_t *) p;
+ pir = (pir_table_t *)p;
break;
}
}
@@ -172,7 +172,8 @@ find_pir_table(unsigned char *base)
csum += *p++;
if ((csum % 256) != 0)
- pir = NULL;
+ fprintf(stderr,
+ "WARNING: PIR table checksum is invalid.\n");
}
return ((pir_table_t *)pir);
OpenPOWER on IntegriCloud