diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-03-09 13:19:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-03-09 13:20:02 +0000 |
commit | 58daab21cd043e1dc37024a7f99b396788372918 (patch) | |
tree | 96771e43bb69f7c1c2b0b4f7374cb74d7866d0cb /web/api/queries/weights.c | |
parent | Releasing debian version 1.43.2-1. (diff) | |
download | netdata-58daab21cd043e1dc37024a7f99b396788372918.tar.xz netdata-58daab21cd043e1dc37024a7f99b396788372918.zip |
Merging upstream version 1.44.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/api/queries/weights.c')
-rw-r--r-- | web/api/queries/weights.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/web/api/queries/weights.c b/web/api/queries/weights.c index fce7b8f24..68af2250f 100644 --- a/web/api/queries/weights.c +++ b/web/api/queries/weights.c @@ -112,7 +112,7 @@ static void register_result(DICTIONARY *results, RRDHOST *host, RRDCONTEXT_ACQUI // we can use the pointer address or RMA as a unique key for each metric char buf[20 + 1]; - ssize_t len = snprintfz(buf, 20, "%p", rma); + ssize_t len = snprintfz(buf, sizeof(buf) - 1, "%p", rma); dictionary_set_advanced(results, buf, len + 1, &t, sizeof(struct register_result), NULL); } @@ -717,7 +717,7 @@ static inline struct dict_unique_name_units *dict_unique_name_units_add(DICTIONA static inline struct dict_unique_id_name *dict_unique_id_name_add(DICTIONARY *dict, const char *id, const char *name, ssize_t *max_id) { char key[1024 + 1]; - snprintfz(key, 1024, "%s:%s", id, name); + snprintfz(key, sizeof(key) - 1, "%s:%s", id, name); struct dict_unique_id_name *dun = dictionary_set(dict, key, NULL, sizeof(struct dict_unique_id_name)); if(!dun->existing) { dun->existing = true; @@ -2047,7 +2047,7 @@ print("\nprob", prob) static int double_expect(double v, const char *str, const char *descr) { char buf[100 + 1]; - snprintfz(buf, 100, "%0.6f", v); + snprintfz(buf, sizeof(buf) - 1, "%0.6f", v); int ret = strcmp(buf, str) ? 1 : 0; fprintf(stderr, "%s %s, expected %s, got %s\n", ret?"FAILED":"OK", descr, str, buf); |