- bugfixes found from cppcheck

This commit is contained in:
Mark Vejvoda
2011-08-31 19:44:19 +00:00
parent f542ce36e4
commit 3af608151e
12 changed files with 351 additions and 82 deletions

View File

@@ -823,6 +823,8 @@ void Model::loadG3d(const string &path, bool deletePixMapAfterLoad,
FileHeader fileHeader;
size_t readBytes = fread(&fileHeader, sizeof(FileHeader), 1, f);
if(strncmp(reinterpret_cast<char*>(fileHeader.id), "G3D", 3) != 0) {
fclose(f);
f = NULL;
printf("In [%s::%s] file = [%s] fileheader.id = [%s][%c]\n",__FILE__,__FUNCTION__,path.c_str(),reinterpret_cast<char*>(fileHeader.id),fileHeader.id[0]);
throw runtime_error("Not a valid G3D model");
}