Skip to contentSkip to conversation

debugreiserfs: fix dereferencing type-punned pointer warning

PATCH New Jeff Mahoney 1 participant 1 message Oct 11, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 5/10 debugreiserfs: fix dereferencing type-punned pointer warning

This patch fixes the following warning:
unpack.c:536:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

---
 debugreiserfs/unpack.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
debugreiserfs/unpack.c +2 -3
index fb93b6b..e71306a 100644
@@ -532,9 +532,8 @@ void unpack_partition (int fd, int jfd)
 	    continue;
 	}
 
-	fread (c + 1, 1, 1, stdin);
-	magic16 = le16_to_cpu(*(__u16 *)c);
-	/*fread16 (&magic16);*/
+	fread16 (&magic16);
+	magic16 = le16_to_cpu(magic16);
 	
 	switch (magic16 & 0xff) {
 	case LEAF_START_MAGIC:
Signature · 1 line
1.7.10.4