Permalink
Browse files

Compare floats as floats.

  • Loading branch information...
1 parent b90bdf2 commit f7919bbee312bdc4f3ed2b7e7796718f19c63720 Alexey Sokolov committed Sep 16, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 znc.cpp
View
@@ -1088,13 +1088,13 @@ bool CZNC::DoRehash(CString& sError)
CString sSavedVersion;
config.FindStringEntry("version", sSavedVersion);
double fSavedVersion = sSavedVersion.ToDouble();
- if (fSavedVersion < VERSION) {
+ if (fSavedVersion < VERSION - 0.000001) {
if (sSavedVersion.empty()) {
sSavedVersion = "< 0.203";
}
CUtils::PrintMessage("Found old config from ZNC " + sSavedVersion + ". Saving a backup of it.");
BackupConfigOnce("pre-" + CString(VERSION, 3));
- } else if (fSavedVersion > VERSION) {
+ } else if (fSavedVersion > VERSION + 0.000001) {
CUtils::PrintError("Config was saved from ZNC " + sSavedVersion + ". It may or may not work with current ZNC " + GetVersion());
}

0 comments on commit f7919bb

Please sign in to comment.