mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 21:12:48 +01: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)
|
||||
{
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user