fix sqlite error messages

This commit is contained in:
ouwou
2021-11-19 01:08:03 -05:00
parent 1da2c57376
commit fc76a15c46

View File

@@ -2140,7 +2140,7 @@ const char *Store::Database::ErrStr() const {
const char *errmsg = sqlite3_errmsg(m_db);
std::string tmp = errstr + std::string("\n\t") + errmsg;
tmp.copy(m_err_scratch, sizeof(m_err_scratch) - 1);
m_err_scratch[sizeof(m_err_scratch) - 1] = '\0';
m_err_scratch[std::min(tmp.size(), sizeof(m_err_scratch) - 1)] = '\0';
return m_err_scratch;
}