Skip to content

Commit 7785af8

Browse files
committed
environment.cpp: use QString::toInt() instead of atoi()
1 parent 0a84e26 commit 7785af8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/environment.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ int environmentGetInt(QString key)
5050
continue;
5151
}
5252
if (line->key == key) {
53-
// TODO: Not ideal
54-
return atoi(line->value.toStdString().c_str());
53+
bool success = false;
54+
int ret = line->value.toInt(&success);
55+
return success ? ret : -1;
5556
}
5657
}
5758
return -1;

0 commit comments

Comments
 (0)