From 33fbebb84ca2d179342c6660a557ffe35d2473e4 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 7 Jun 2018 19:14:37 +0200 Subject: Move default initialisation to constructor. --- src/versionstr.cc | 7 ++++--- src/versionstr.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/versionstr.cc b/src/versionstr.cc index be6913b..8c6c66f 100644 --- a/src/versionstr.cc +++ b/src/versionstr.cc @@ -46,6 +46,7 @@ VersionStr::VersionStr(const std::string& v) { + version = {{0, 0, 0}}; set(v); } @@ -66,7 +67,7 @@ void VersionStr::set(const std::string& v) { if(idx > 2) { - version = {0, 0, 0}; + version = {{0, 0, 0}}; ERR(version, "Version string is too long."); return; } @@ -80,14 +81,14 @@ void VersionStr::set(const std::string& v) } else { - version = {0, 0, 0}; + version = {{0, 0, 0}}; ERR(version, "Version string contains illegal character."); return; } } if(idx > 2) { - version = {0, 0, 0}; + version = {{0, 0, 0}}; ERR(version, "Version string is too long."); return; } diff --git a/src/versionstr.h b/src/versionstr.h index 9fc2fcd..2a8a131 100644 --- a/src/versionstr.h +++ b/src/versionstr.h @@ -108,5 +108,5 @@ public: private: void set(const std::string& v); - std::array version = {0, 0, 0}; + std::array version; }; -- cgit v1.2.3