Commit bdd3995e authored by Chen Bill's avatar Chen Bill Committed by GitHub

Improve error message handling in DataManager (#2839)

parent c4212244
...@@ -165,8 +165,7 @@ void DataManager::ReadStringConfLine(const char* linebuf) { ...@@ -165,8 +165,7 @@ void DataManager::ReadStringConfLine(const char* linebuf) {
} }
} }
bool DataManager::Error(sqlite3* pDB, sqlite3_stmt* pStmt) { bool DataManager::Error(sqlite3* pDB, sqlite3_stmt* pStmt) {
errmsg[0] = '\0'; std::snprintf(errmsg, sizeof errmsg, "%s", sqlite3_errmsg(pDB));
std::strncat(errmsg, sqlite3_errmsg(pDB), sizeof errmsg - 1);
if(pStmt) if(pStmt)
sqlite3_finalize(pStmt); sqlite3_finalize(pStmt);
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment