diff options
author | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2009-09-01 09:32:26 -0300 |
---|---|---|
committer | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2009-09-01 09:32:26 -0300 |
commit | 8c7c09cc636a745fb88e00a5e0a2b2738ab5945e (patch) | |
tree | 4f7dec255cbbfbbb3e57433dc3cd54fe840d7653 /storage/ndb/src/mgmsrv/InitConfigFileParser.cpp | |
parent | 6bc9610022dc2c14a4aa291f3ff04e7f55693603 (diff) | |
download | mariadb-git-8c7c09cc636a745fb88e00a5e0a2b2738ab5945e.tar.gz |
Bug#45611: Minor code cleanup
Remove a self assignment.
Rework a few constructs to avoid a potential overflow.
Based upon patch contributed by Michal Hrusecky
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
Remove self assignment, the object is being initialized.
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
Setup the string in a single snprintf.
Diffstat (limited to 'storage/ndb/src/mgmsrv/InitConfigFileParser.cpp')
-rw-r--r-- | storage/ndb/src/mgmsrv/InitConfigFileParser.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp b/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp index 569cb1eb654..560a9559999 100644 --- a/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp +++ b/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp @@ -208,11 +208,10 @@ InitConfigFileParser::run_config_rules(Context& ctx) ctx.m_config->put("NoOfNodes", nNodes); char tmpLine[MAX_LINE_LENGTH]; - BaseString::snprintf(tmpLine, MAX_LINE_LENGTH, "EXTERNAL SYSTEM_"); - strncat(tmpLine, system, MAX_LINE_LENGTH); - strncat(tmpLine, ":NoOfConnections", MAX_LINE_LENGTH); + BaseString::snprintf(tmpLine, MAX_LINE_LENGTH, + "EXTERNAL SYSTEM_%s:NoOfConnections", system); ctx.m_config->put(tmpLine, nExtConnections); - + Config * ret = new Config(); ret->m_configValues = (struct ndb_mgm_configuration*)ctx.m_configValues.getConfigValues(); ret->m_oldConfig = ctx.m_config; ctx.m_config = 0; |