summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2018-06-07 19:14:37 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2018-06-07 19:20:09 +0200
commit33fbebb84ca2d179342c6660a557ffe35d2473e4 (patch)
treeed66f5373e612b972493a293a74576f2e1c309b1
parent93fe142f21e501a9ff12432d35fbf89b87135f9c (diff)
Move default initialisation to constructor.
-rw-r--r--src/versionstr.cc7
-rw-r--r--src/versionstr.h2
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<size_t, 3> version = {0, 0, 0};
+ std::array<size_t, 3> version;
};