aboutsummaryrefslogtreecommitdiff
path: root/sibs
diff options
context:
space:
mode:
Diffstat (limited to 'sibs')
-rw-r--r--sibs/SafeSerializer.hpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/sibs/SafeSerializer.hpp b/sibs/SafeSerializer.hpp
index e081585..72ef5a3 100644
--- a/sibs/SafeSerializer.hpp
+++ b/sibs/SafeSerializer.hpp
@@ -21,7 +21,7 @@ namespace sibs
void add(const T &data)
{
usize offset = buffer.size();
- buffer.resize(buffer.size() + sizeof(data));
+ buffer.resize(buffer.size() + sizeof(T));
#ifdef LITTLE_ENDIAN
switch(sizeof(T))
{
@@ -39,15 +39,15 @@ namespace sibs
break;
default:
{
- for(int i = 0; i < sizeof(data); ++i)
+ for(int i = 0; i < sizeof(T); ++i)
{
- buffer[offset + i] = ((char*)&data)[sizeof(data) - 1 - i];
+ buffer[offset + i] = ((char*)&data)[sizeof(T) - 1 - i];
}
break;
}
}
#else
- memcpy(&buffer[offset], &data, sizeof(data));
+ memcpy(&buffer[offset], &data, sizeof(T));
#endif
}