summaryrefslogtreecommitdiff
path: root/gzip.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-05-12 16:51:03 -0400
committerJeffrey Walton <noloader@gmail.com>2017-05-12 16:51:03 -0400
commitcfa339535bdf15054cf9fee7861f963630b0213e (patch)
tree91f08c0055a95b4a8fd423f8e8f69bc6acad000e /gzip.cpp
parent591b13934336a73edcc429f27d340a5fb91d51c6 (diff)
downloadcryptopp-git-cfa339535bdf15054cf9fee7861f963630b0213e.tar.gz
Revert "Write MTIME in big-endian order"
This reverts commit 591b13934336. RFC 1952 states the bytes are written in little-endian order, not big-endian. That includes MTIME.
Diffstat (limited to 'gzip.cpp')
-rw-r--r--gzip.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/gzip.cpp b/gzip.cpp
index 27972a1d..4b4869b4 100644
--- a/gzip.cpp
+++ b/gzip.cpp
@@ -26,7 +26,7 @@ void Gzip::WritePrestreamHeader()
AttachedTransformation()->Put(MAGIC2);
AttachedTransformation()->Put(DEFLATED);
AttachedTransformation()->Put((byte)flags); // general flag
- AttachedTransformation()->PutWord32(m_filetime, BIG_ENDIAN_ORDER); // time stamp
+ AttachedTransformation()->PutWord32(m_filetime, LITTLE_ENDIAN_ORDER); // time stamp
byte extra = (GetDeflateLevel() == 1) ? FAST : ((GetDeflateLevel() == 9) ? SLOW : 0);
AttachedTransformation()->Put(extra);
AttachedTransformation()->Put(GZIP_OS_CODE);
@@ -51,7 +51,7 @@ void Gzip::WritePoststreamTail()
SecByteBlock crc(4);
m_crc.Final(crc);
AttachedTransformation()->Put(crc, 4);
- AttachedTransformation()->PutWord32(m_totalLen, BIG_ENDIAN_ORDER);
+ AttachedTransformation()->PutWord32(m_totalLen, LITTLE_ENDIAN_ORDER);
m_filetime = 0;
m_filename.clear();