OSDN Git Service

Fix byte assignment in read_boot_u16().
authorPeter Jones <pjones@redhat.com>
Fri, 6 Sep 2013 14:57:50 +0000 (10:57 -0400)
committerPeter Jones <pjones@redhat.com>
Mon, 13 Jan 2014 21:28:56 +0000 (16:28 -0500)
It helps if you put the bytes in the right order, and the parenthesis
around the right things to keep them from being all zero.

Signed-off-by: Peter Jones <pjones@redhat.com>
src/efibootmgr/efibootmgr.c

index ae73884..a774ee2 100644 (file)
@@ -370,7 +370,7 @@ read_boot_u16(const char *name)
        if (rc < 0)
                return rc;
 
-       rc = (data[0] & 0xff << 8) | (data[1] & 0xff);
+       rc = (data[0] & 0xff) | ((data[1] & 0xff) << 8);
        return rc;
 }