diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2010-08-13 10:56:03 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2010-08-13 10:56:03 -0700 |
commit | 5ed312ef6122c7f652c0c07e4357721b4dda8f4f (patch) | |
tree | 2f9e6f44104056bf6ee51ef80f5d0ff9adc8b650 /src/cstore/cstore-c.cpp | |
parent | 2aa6d8c6b022f6702437be126eacbe75be5d10aa (diff) | |
download | vyatta-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.cpp | 4 |
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(); |