summaryrefslogtreecommitdiff
path: root/src/cstore/cstore-varref.cpp
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2010-08-13 10:56:03 -0700
committerAn-Cheng Huang <ancheng@vyatta.com>2010-08-13 10:56:03 -0700
commit5ed312ef6122c7f652c0c07e4357721b4dda8f4f (patch)
tree2f9e6f44104056bf6ee51ef80f5d0ff9adc8b650 /src/cstore/cstore-varref.cpp
parent2aa6d8c6b022f6702437be126eacbe75be5d10aa (diff)
downloadvyatta-cfg-5ed312ef6122c7f652c0c07e4357721b4dda8f4f.tar.gz
vyatta-cfg-5ed312ef6122c7f652c0c07e4357721b4dda8f4f.zip
change all vector/string size to size_t just to be safe.
* would have been a problem if template tree becomes more than 2^32 levels deep or if value strings longer than 2^32 characters are allowed.
Diffstat (limited to 'src/cstore/cstore-varref.cpp')
-rw-r--r--src/cstore/cstore-varref.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cstore/cstore-varref.cpp b/src/cstore/cstore-varref.cpp
index 46950fa..f00ed38 100644
--- a/src/cstore/cstore-varref.cpp
+++ b/src/cstore/cstore-varref.cpp
@@ -166,7 +166,7 @@ Cstore::VarRef::process_ref(const vector<string>& ref_comps,
// tag node
vector<string> cnodes;
_cstore->cfgPathGetChildNodes(pcomps, cnodes, _active);
- for (unsigned int i = 0; i < cnodes.size(); i++) {
+ for (size_t i = 0; i < cnodes.size(); i++) {
pcomps.push_back(cnodes[i]);
process_ref(rcomps, pcomps, def.def_type);
pcomps.pop_back();
@@ -198,7 +198,7 @@ Cstore::VarRef::process_ref(const vector<string>& ref_comps,
return;
}
string val;
- for (unsigned int i = 0; i < vals.size(); i++) {
+ for (size_t i = 0; i < vals.size(); i++) {
if (val.length() > 0) {
val += " ";
}
@@ -227,7 +227,7 @@ Cstore::VarRef::getValue(string& value, vtw_type_e& def_type)
vector<string> result;
map<string, bool> added;
def_type = ERROR_TYPE;
- for (unsigned int i = 0; i < _paths.size(); i++) {
+ for (size_t i = 0; i < _paths.size(); i++) {
if (_paths[i].first.size() == 0) {
// empty path
continue;
@@ -259,7 +259,7 @@ Cstore::VarRef::getValue(string& value, vtw_type_e& def_type)
def_type = TEXT_TYPE;
}
value = "";
- for (unsigned int i = 0; i < result.size(); i++) {
+ for (size_t i = 0; i < result.size(); i++) {
if (i > 0) {
value += " ";
}