Skip to content

Commit b87173c

Browse files
committed
Correctly initialize config filename.
1 parent 05569c8 commit b87173c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/api_config.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ api_config::api_config() {
5656
std::vector<std::string> filenames;
5757

5858
// NOLINTNEXTLINE(concurrency-mt-unsafe)
59-
if (api_config_filename_ != "") {
59+
if (!api_config_filename_.empty()) {
6060
// if a config file name was set, use it if it is readable
6161
if (file_is_readable(api_config_filename_)) {
6262
filenames.insert(filenames.begin(), api_config_filename_);

src/api_config.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ class api_config {
236236
*/
237237
void load_from_file(const std::string &filename = std::string());
238238

239-
static std::string api_config_filename_ = "";
239+
static std::string api_config_filename_;
240240

241241
// core parameters
242242
bool allow_ipv6_, allow_ipv4_;
@@ -275,6 +275,10 @@ class api_config {
275275
float smoothing_halftime_;
276276
bool force_default_timestamps_;
277277
};
278+
279+
// initialize configuration file name
280+
inline std::string api_config::api_config_filename_ = "";
281+
278282
} // namespace lsl
279283

280284
#endif

0 commit comments

Comments
 (0)