corrected a bug that i introduced when i templated these functions

This commit is contained in:
Paolo Cignoni 2009-10-29 17:20:13 +00:00
parent 6247e5efdc
commit 6befc46a59
1 changed files with 3 additions and 1 deletions

View File

@ -184,6 +184,7 @@ template<class ScalarType>
(fname2==0 || CheckCacheTime(fname2,d)) ) (fname2==0 || CheckCacheTime(fname2,d)) )
{ {
// Lettura bbox e controllo // Lettura bbox e controllo
Box3d readBB;
FILE * fp = fopen(d,"rb"); FILE * fp = fopen(d,"rb");
if(fp==0) return false; if(fp==0) return false;
if( fread(h,1,8,fp)!=8 ) if( fread(h,1,8,fp)!=8 )
@ -191,12 +192,13 @@ template<class ScalarType>
fclose(fp); fclose(fp);
return false; return false;
} }
if( fread(&box,sizeof(Box3d),1,fp)!=1 ) if( fread(&readBB,sizeof(Box3d),1,fp)!=1 )
{ {
fclose(fp); fclose(fp);
return false; return false;
} }
fclose(fp); fclose(fp);
box.Import(readBB);
if( strncmp(h,bboxheader,8) ) if( strncmp(h,bboxheader,8) )
return false; return false;
else else