Added GetArgInt function
[novacoin.git] / src / util.cpp
index d434c81..f540500 100644 (file)
@@ -588,6 +588,13 @@ int64_t GetArg(const std::string& strArg, int64_t nDefault)
     return nDefault;
 }
 
+int32_t GetArgInt(const std::string& strArg, int32_t nDefault)
+{
+    if (mapArgs.count(strArg))
+        return strtol(mapArgs[strArg]);
+    return nDefault;
+}
+
 bool GetBoolArg(const std::string& strArg, bool fDefault)
 {
     if (mapArgs.count(strArg))
@@ -1272,7 +1279,7 @@ void ShrinkDebugFile()
         // Restart the file with some of the end
         char pch[200000];
         fseek(file, -((long long)sizeof(pch)), SEEK_END);
-        int nBytes = fread(pch, 1, sizeof(pch), file);
+        size_t nBytes = fread(pch, 1, sizeof(pch), file);
         fclose(file);
 
         file = fopen(pathLog.string().c_str(), "w");