From: Perttu Ahola Date: Tue, 15 Nov 2011 08:52:00 +0000 (+0200) Subject: Fix yet-another serialization error in utility.h and set constructor of Buffer take... X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=7bdc328a7191024287d9f1e5a24ba4f96fb9ca50;p=zefram%2Fminetest%2Fminetest_engine.git Fix yet-another serialization error in utility.h and set constructor of Buffer take const data for copying --- diff --git a/src/utility.h b/src/utility.h index 98fa83e8..ed368b20 100644 --- a/src/utility.h +++ b/src/utility.h @@ -225,7 +225,7 @@ inline u16 readU16(std::istream &is) inline void writeU32(std::ostream &os, u32 p) { char buf[4]; - writeU16((u8*)buf, p); + writeU32((u8*)buf, p); os.write(buf, 4); } inline u32 readU32(std::istream &is) @@ -367,7 +367,7 @@ public: else data = NULL; } - Buffer(T *t, unsigned int size) + Buffer(const T *t, unsigned int size) { m_size = size; if(size != 0)