Blob Blame History Raw
Description: Fix FTBFS on big-endian architectures
 Correctly convert byte encoding for 32bit value from little-endian
 order to host byte order.
Origin: vendor
Bug-Debian: http://bugs.debian.org/743503
Author: Jurica Stanojkovic <jurica.stanojkovic@imgtec.com> 
Author: Salvatore Bonaccorso <carnil@debian.org>
Last-Update: 2014-04-03

--- a/src/line_buffer.cc
+++ b/src/line_buffer.cc
@@ -36,6 +36,7 @@
 #include <string.h>
 #include <fcntl.h>
 #include <unistd.h>
+#include <endian.h>
 
 #ifdef HAVE_BZLIB_H
 #include <bzlib.h>
@@ -182,7 +183,7 @@
                             throw error(errno);
                         }
                     }
-                    this->lb_file_time = *((int32_t *)&gz_id[4]);
+                    this->lb_file_time = le32toh(*((int32_t *)&gz_id[4]));
                     if (this->lb_file_time < 0)
                         this->lb_file_time = 0;
                     this->lb_gz_offset = lseek(this->lb_fd, 0, SEEK_CUR);