[Gridflow-cvs] [svn] commit: r5444 - /trunk/src/formats.cxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Thu Apr 15 17:02:34 EDT 2010


Author: matju
Date: Thu Apr 15 17:02:34 2010
New Revision: 5444

Log:
fixed the other libc warning

Modified:
    trunk/src/formats.cxx

Modified: trunk/src/formats.cxx
==============================================================================
--- trunk/src/formats.cxx (original)
+++ trunk/src/formats.cxx Thu Apr 15 17:02:34 2010
@@ -241,7 +241,8 @@
 } GRID_FLOW {
 #define FOO(T) {T data2[n]; for(int i=0; i<n; i++) data2[i]=(T)data[i]; \
 		if (endian!=is_le()) swap_endian(n,data2); \
-		fwrite(data2,n,sizeof(T),f);}
+		size_t sz = n*sizeof(T); \
+		if (fwrite(data2,1,sz,f)<sz) FRAISE(fwrite,f);}
 TYPESWITCH(in->nt,FOO,)
 #undef FOO
 } GRID_FINISH {



More information about the Gridflow-cvs mailing list