summaryrefslogtreecommitdiff
path: root/src/cstore/cstore-c.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-c.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-c.cpp')
-rw-r--r--src/cstore/cstore-c.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cstore/cstore-c.cpp b/src/cstore/cstore-c.cpp
index 95f052b..fd818a5 100644
--- a/src/cstore/cstore-c.cpp
+++ b/src/cstore/cstore-c.cpp
@@ -150,7 +150,7 @@ cstore_path_string_to_path_comps(const char *path_str, int *num_comps)
size_t len = strlen(pstr);
vector<string> vec;
char *start = NULL;
- for (unsigned int i = 0; i < len; i++) {
+ for (size_t i = 0; i < len; i++) {
if (pstr[i] == '/') {
if (start) {
pstr[i] = 0;
@@ -168,7 +168,7 @@ cstore_path_string_to_path_comps(const char *path_str, int *num_comps)
}
char **ret = (char **) malloc(sizeof(char *) * vec.size());
if (ret) {
- for (unsigned int i = 0; i < vec.size(); i++) {
+ for (size_t i = 0; i < vec.size(); i++) {
ret[i] = strdup(vec[i].c_str());
}
*num_comps = vec.size();