changeset 2945:48838736005d draft

Merge branch '0.4.x' into 0.5.x Conflicts: contrib/Bitcoin.app/Contents/Info.plist doc/README doc/README_windows.txt share/setup.nsi src/protocol.h src/serialize.h
author Luke Dashjr <luke-jr+git@utopios.org>
date Fri, 27 Apr 2012 10:53:14 -0400
parents 65d19e22d386 (current diff) 24145a9d8538 (diff)
children 3d43fc6fb29e
files doc/README doc/README_windows.txt share/setup.nsi src/main.h src/net.cpp src/protocol.cpp src/protocol.h src/serialize.h
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/main.h
+++ b/src/main.h
@@ -971,9 +971,10 @@
         fileout << FLATDATA(pchMessageStart) << nSize;
 
         // Write block
-        nBlockPosRet = ftell(fileout);
-        if (nBlockPosRet == -1)
+        long fileOutPos = ftell(fileout);
+        if (fileOutPos < 0)
             return error("CBlock::WriteToDisk() : ftell failed");
+        nBlockPosRet = fileOutPos;
         fileout << *this;
 
         // Flush stdio buffers and commit to disk before returning