Fix for strings containing spaces.

[04-string-download]
This commit is contained in:
Gavin Lambert 2014-05-31 17:21:53 +12:00
parent 1d35113c85
commit e3e96acb69
1 changed files with 4 additions and 1 deletions

View File

@ -33,6 +33,7 @@
#include <iostream>
#endif
#include <string.h>
#include <iomanip>
#include <sstream>
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
{