From 5e63f619c0ea0d16babd26d98d14489c311c5ebe Mon Sep 17 00:00:00 2001 From: =?utf8?q?Felix=20D=C3=B6rre?= Date: Sat, 21 Feb 2015 01:40:03 +0100 Subject: [PATCH] Fix: coverity complaining about memory corruption --- src/io/record.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/io/record.h b/src/io/record.h index 29c05ca..27c40c1 100644 --- a/src/io/record.h +++ b/src/io/record.h @@ -57,8 +57,8 @@ public: } template - static void read( std::string::iterator& it, T& val ) { - char* data = ( char* ) &val; + static void read( std::string::iterator& it, T&& val ) { + char* data = reinterpret_cast( &val ); for( size_t i = 0; i < sizeof( T ); i++ ) { data[i] = *it; -- 2.39.2