mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-17 18:40:09 +00:00
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.
This commit is contained in:
parent
24de922636
commit
10ab9c2f42
@ -1836,7 +1836,7 @@ bool CheckDiskSpace(uint64 nAdditionalBytes)
|
|||||||
|
|
||||||
FILE* OpenBlockFile(unsigned int nFile, unsigned int nBlockPos, const char* pszMode)
|
FILE* OpenBlockFile(unsigned int nFile, unsigned int nBlockPos, const char* pszMode)
|
||||||
{
|
{
|
||||||
if (nFile == -1)
|
if ((nFile < 1) || (nFile == (unsigned int) -1))
|
||||||
return NULL;
|
return NULL;
|
||||||
FILE* file = fopen((GetDataDir() / strprintf("blk%04d.dat", nFile)).string().c_str(), pszMode);
|
FILE* file = fopen((GetDataDir() / strprintf("blk%04d.dat", nFile)).string().c_str(), pszMode);
|
||||||
if (!file)
|
if (!file)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user