shithub: riscv

Download patch

ref: 10c71f2b5c0fa637fcc244ccd7cbca24bb904f8a
parent: 2b4f4f88aa9f86ad4836a08611d2027616b9ca8b
author: Jacob Moody <moody@posixcafe.org>
date: Wed May 3 12:53:55 EDT 2023

disk/qcowfs: correct GET2 off by one

--- a/sys/src/cmd/disk/qcowfs.c
+++ b/sys/src/cmd/disk/qcowfs.c
@@ -74,7 +74,7 @@
 };
 
 #define PUT2(p, u) (p)[0] = (u)>>8, (p)[1] = (u)
-#define GET2(p) (u16int)(p)[2] | (u16int)(p)[1]<<8
+#define GET2(p) (u16int)(p)[1] | (u16int)(p)[0]<<8
 #define PUT4(p, u) (p)[0] = (u)>>24, (p)[1] = (u)>>16, (p)[2] = (u)>>8, (p)[3] = (u)
 #define GET4(p)	(u32int)(p)[3] | (u32int)(p)[2]<<8 | (u32int)(p)[1]<<16 | (u32int)(p)[0]<<24