$OpenBSD: patch-lz4jsoncat_c,v 1.1.1.1 2016/04/04 11:26:22 jca Exp $

Fix little endian assumption.

--- lz4jsoncat.c.orig	Fri Apr  1 15:32:34 2016
+++ lz4jsoncat.c	Fri Apr  1 19:00:45 2016
@@ -27,6 +27,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <stdint.h>
+#include <endian.h>
 
 #include "lz4.h"
 
@@ -61,7 +62,7 @@ int main(int ac, char **av)
 			fprintf(stderr, "%s: not a mozLZ4a file\n", *av);
 			exit(1);
 		}
-		size_t outsz = *(uint32_t *) (map + 8);
+		size_t outsz = le32toh(*(uint32_t *) (map + 8));
 		char *out = malloc(outsz);
 		if (!out) {
 			fprintf(stderr, "Cannot allocate memory\n");
