Carl-Daniel Hailfinger wrote:
Sorry. I had a correct version, but it seems I pressed undo before saving.
Fix coreboot image detection heuristic.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
I wonder whether it makes sense to explicitly say !=0 for the non-isprint parts to express that those are not booleans but checks whether a char is 0 I'm still not sure this really shows the correct behavior, but I guess it will compile on 64bit systems like this.
Acked-by: Stefan Reinauer stepan@coresystems.de
Index: flashrom-tmp1/layout.c
--- flashrom-tmp1/layout.c (Revision 3412) +++ flashrom-tmp1/layout.c (Arbeitskopie) @@ -65,10 +65,10 @@ */ if ((*walk) == 0 || ((*walk) & 0x3ff) != 0 || *walk > size || *(walk - 1) > size || *(walk - 2) > size ||
(!isprint((const char *)(bios + size - *(walk - 1))) &&
((const char *)(bios + size - *(walk - 1)))) ||
(!isprint((const char *)(bios + size - *(walk - 2))) &&
((const char *)(bios + size - *(walk - 2))))) {
(!isprint(*(const char *)(bios + size - *(walk - 1))) &&
(*(const char *)(bios + size - *(walk - 1)))) ||
(!isprint(*(const char *)(bios + size - *(walk - 2))) &&
printf("Flash image seems to be a legacy BIOS. Disabling checks.\n"); mainboard_vendor = def_name; mainboard_part = def_name;(*(const char *)(bios + size - *(walk - 2))))) {