summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 190a5e1)
raw | patch | inline | side by side (parent: 190a5e1)
author | daryder <daryder@cisco.com> | |
Mon, 3 Nov 2014 20:55:15 +0000 (15:55 -0500) | ||
committer | daryder <daryder@cisco.com> | |
Mon, 3 Nov 2014 20:55:15 +0000 (15:55 -0500) |
src/ceph.c | patch | blob | history |
diff --git a/src/ceph.c b/src/ceph.c
index 06d57af666349d0d5b09042fa28515e69c9ad85e..fb215ef99fda7c0f02f1e4c97c446040dc772390 100644 (file)
--- a/src/ceph.c
+++ b/src/ceph.c
char *keys[16];
char len_str[3];
char tmp[DATA_MAX_NAME_LEN];
+ size_t key_chars_remaining = (DATA_MAX_NAME_LEN-1);
int reserved = 0;
int offset = 0;
memset(tmp, 0, sizeof(tmp));
/** concatenate each part of source string **/
for(i = 0; i < keys_num; i++)
{
- strcat(tmp, keys[i]);
+ strncat(tmp, keys[i], key_chars_remaining);
+ key_chars_remaining -= strlen(keys[i]);
}
- tmp[DATA_MAX_NAME_LEN - 1] = '\0';
/** to coordinate limitation of length of ds name from RRD
* we will truncate ds_name
* when the its length is more than