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 <[EMAIL PROTECTED]>
>   

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 <[EMAIL PROTECTED]>
> 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))) &&
> +             (*(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;
>
>
>   


-- 
coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
      Tel.: +49 761 7668825 • Fax: +49 761 7664613
Email: [EMAIL PROTECTED]  • http://www.coresystems.de/
Registergericht: Amtsgericht Freiburg • HRB 7656
Geschäftsführer: Stefan Reinauer • Ust-IdNr.: DE245674866


-- 
coreboot mailing list
[email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to