Skip to content

Commit 2d89574

Browse files
committed
Update config.hpp
1 parent 3f01a4c commit 2d89574

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

include/simulation/config.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,19 @@ struct DefaultConf
5252
if (line[0] == '#') {
5353
continue;
5454
}
55+
const char* line_c = line.c_str();
5556
switch (line_count) {
5657
case 0:
57-
DefaultConf<T>::WIN_WIDTH = std::atoi(line.c_str());
58+
DefaultConf<T>::WIN_WIDTH = std::atoi(line_c);
5859
break;
5960
case 1:
60-
DefaultConf<T>::WIN_HEIGHT = std::atoi(line.c_str());
61+
DefaultConf<T>::WIN_HEIGHT = std::atoi(line_c);
6162
break;
6263
case 2:
63-
DefaultConf<T>::USE_FULLSCREEN = std::atoi(line.c_str());
64+
DefaultConf<T>::USE_FULLSCREEN = std::atoi(line_c);
6465
break;
6566
case 3:
66-
DefaultConf<T>::ANTS_COUNT = std::atoi(line.c_str());
67+
DefaultConf<T>::ANTS_COUNT = std::atoi(line_c);
6768
break;
6869
default:
6970
break;

0 commit comments

Comments
 (0)