diff --git a/drogon_ctl/create_model.cc b/drogon_ctl/create_model.cc index 8ebbe1de..4cf11bd9 100644 --- a/drogon_ctl/create_model.cc +++ b/drogon_ctl/create_model.cc @@ -87,7 +87,6 @@ void create_model::createModelClassFromPG(const std::string &path, const DbClien { auto row = r[i]; ColumnInfo info; - memset(&info, 0, sizeof(info)); info._index = i; info._dbType = "pg"; info._colName = row["column_name"].as(); @@ -315,7 +314,6 @@ void create_model::createModelClassFromMysql(const std::string &path, const DbCl if (!isNull) { ColumnInfo info; - memset(&info, 0, sizeof(info)); info._index = i; info._dbType = "pg"; info._colName = field; diff --git a/drogon_ctl/create_model.h b/drogon_ctl/create_model.h index 987f4995..d0e82c02 100644 --- a/drogon_ctl/create_model.h +++ b/drogon_ctl/create_model.h @@ -38,7 +38,7 @@ struct ColumnInfo std::string _colDatabaseType; std::string _dbType; ssize_t _colLength = -1; - size_t _index; + size_t _index = 0; bool _isAutoVal = false; bool _isPrimaryKey = false; bool _notNull = false;