Fix yet-another serialization error in utility.h and set constructor of Buffer take const data for copying

This commit is contained in:
Perttu Ahola 2011-11-15 10:52:00 +02:00
parent e71744b918
commit 7bdc328a71

@ -225,7 +225,7 @@ inline u16 readU16(std::istream &is)
inline void writeU32(std::ostream &os, u32 p) inline void writeU32(std::ostream &os, u32 p)
{ {
char buf[4]; char buf[4];
writeU16((u8*)buf, p); writeU32((u8*)buf, p);
os.write(buf, 4); os.write(buf, 4);
} }
inline u32 readU32(std::istream &is) inline u32 readU32(std::istream &is)
@ -367,7 +367,7 @@ public:
else else
data = NULL; data = NULL;
} }
Buffer(T *t, unsigned int size) Buffer(const T *t, unsigned int size)
{ {
m_size = size; m_size = size;
if(size != 0) if(size != 0)