Use std::numeric_limits<> for typesafe INT_MAX/etc
This commit is contained in:
@@ -101,7 +101,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
|
||||
case ProxyPort:
|
||||
{
|
||||
int nPort = atoi(value.toString().toAscii().data());
|
||||
if (nPort > 0 && nPort < USHRT_MAX)
|
||||
if (nPort > 0 && nPort < std::numeric_limits<unsigned short>::max())
|
||||
{
|
||||
addrProxy.port = htons(nPort);
|
||||
walletdb.WriteSetting("addrProxy", addrProxy);
|
||||
|
||||
@@ -187,7 +187,7 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx)
|
||||
|
||||
// Sort order, unrecorded transactions sort to the top
|
||||
status.sortKey = strprintf("%010d-%01d-%010u-%03d",
|
||||
(pindex ? pindex->nHeight : INT_MAX),
|
||||
(pindex ? pindex->nHeight : std::numeric_limits<int>::max()),
|
||||
(wtx.IsCoinBase() ? 1 : 0),
|
||||
wtx.nTimeReceived,
|
||||
idx);
|
||||
|
||||
Reference in New Issue
Block a user