aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorJeff Garzik <[email protected]>2012-05-01 17:50:33 -0400
committerJeff Garzik <[email protected]>2012-05-01 17:50:33 -0400
commit10ab9c2f4279e182f61a86a65f3a9b9cdba1df83 (patch)
treef37a876ccb8711f57bbe58f71bbf3f6ff58ba5da /src/main.cpp
parentCDiskTxPos, CInPoint, COutPoint: cast null value (-1) to unsigned int (diff)
downloaddiscoin-10ab9c2f4279e182f61a86a65f3a9b9cdba1df83.tar.xz
discoin-10ab9c2f4279e182f61a86a65f3a9b9cdba1df83.zip
OpenBlockFile(): cast to eliminate signed/unsigned comparison warning
nFile's null value is -1. Cast that to unsigned int, to avoid warning. Additionally, avoid nFile==0 because the first valid value is 1.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 427e435a9..78427e0d3 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1836,7 +1836,7 @@ bool CheckDiskSpace(uint64 nAdditionalBytes)
FILE* OpenBlockFile(unsigned int nFile, unsigned int nBlockPos, const char* pszMode)
{
- if (nFile == -1)
+ if ((nFile < 1) || (nFile == (unsigned int) -1))
return NULL;
FILE* file = fopen((GetDataDir() / strprintf("blk%04d.dat", nFile)).string().c_str(), pszMode);
if (!file)