Fix spacing issue for NIF file errors.

moveref
Arthur Moore 10 years ago
parent 018f4e6895
commit cd835152e1

@ -46,14 +46,14 @@ public:
/// Used if file parsing fails /// Used if file parsing fails
void fail(const std::string &msg) void fail(const std::string &msg)
{ {
std::string err = "NIFFile Error: " + msg; std::string err = " NIFFile Error: " + msg;
err += "\nFile: " + filename; err += "\nFile: " + filename;
throw std::runtime_error(err); throw std::runtime_error(err);
} }
/// Used when something goes wrong, but not catastrophically so /// Used when something goes wrong, but not catastrophically so
void warn(const std::string &msg) void warn(const std::string &msg)
{ {
std::cerr << "NIFFile Warning: " << msg <<std::endl std::cerr << " NIFFile Warning: " << msg <<std::endl
<< "File: " << filename <<std::endl; << "File: " << filename <<std::endl;
} }

@ -86,7 +86,7 @@ std::string NIFStream::getString(size_t length)
//Make sure we're not reading in too large of a string //Make sure we're not reading in too large of a string
unsigned int fileSize = inp->size(); unsigned int fileSize = inp->size();
if(fileSize != 0 && fileSize < length) if(fileSize != 0 && fileSize < length)
file->fail("Attempted to read a string with " + Ogre::StringConverter::toString(length) + "characters , but file is only "+Ogre::StringConverter::toString(fileSize)+ "bytes!"); file->fail("Attempted to read a string with " + Ogre::StringConverter::toString(length) + " characters , but file is only "+Ogre::StringConverter::toString(fileSize)+ " bytes!");
std::vector<char> str (length+1, 0); std::vector<char> str (length+1, 0);

Loading…
Cancel
Save