diff --git a/tool/DataTypeHandler.cpp b/tool/DataTypeHandler.cpp index ca7dcfed..abc55b6d 100644 --- a/tool/DataTypeHandler.cpp +++ b/tool/DataTypeHandler.cpp @@ -33,6 +33,7 @@ #include #endif +#include #include #include using namespace std; @@ -106,6 +107,8 @@ size_t DataTypeHandler::interpretAsType( stringstream str; size_t dataSize = type->byteSize; + memset(target, 0, targetSize); + #if DEBUG cerr << __func__ << "(targetSize=" << targetSize << ")" << endl; #endif @@ -192,7 +195,7 @@ size_t DataTypeHandler::interpretAsType( << dataSize << " > " << targetSize << ")"; throw SizeException(err.str()); } - str >> (char *) target; + str.read((char *) target, dataSize); break; case 0x0011: // double {