From 32aee72d295e2de3c890791b61ab9741b99912b1 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Thu, 4 Sep 2014 18:28:56 +0900 Subject: wrong iseq conversion flag --- src/load.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'src/load.c') diff --git a/src/load.c b/src/load.c index 80fc719c2..bf69fdca1 100644 --- a/src/load.c +++ b/src/load.c @@ -507,20 +507,22 @@ read_binary_header(const uint8_t *bin, size_t *bin_size, uint16_t *crc, mrb_bool { const struct rite_binary_header *header = (const struct rite_binary_header *)bin; - *byteorder = FALSE; + if (byteorder) *byteorder = FALSE; if (memcmp(header->binary_identify, RITE_BINARY_IDENTIFIER, sizeof(header->binary_identify)) != 0) { - uint32_t ident = 0; - size_t i; + if (byteorder) { + uint32_t ident = 0; + size_t i; - for(i=0; ibinary_identify) { - *byteorder = TRUE; - } - else { - return MRB_DUMP_INVALID_FILE_HEADER; + for(i=0; ibinary_identify) { + *byteorder = TRUE; + } + else { + return MRB_DUMP_INVALID_FILE_HEADER; + } } } -- cgit v1.2.3