@@ -57,6 +57,9 @@ bool UserManager::addUser(const std::string &name, const std::string &pw) {
if (ret != 0)
return false;
+ // remove trailing terminator chars
+ hash.resize(hash.find('\0'));
+
user_map.insert(std::pair<std::string, std::string>(name, hash));
writeToFile(user_map);
return true;