X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Futils_cache.c;h=824b7c80bcf6d64abd506991855aaea9bd7e4633;hb=d3fc6d0831a63af2e96300f488a9f8f5fc3183fb;hp=793841213f7d07e5464e230b00d3de9247a3d352;hpb=8455c2452e0249631dbb12b9902cfdb2e61f11e7;p=collectd.git diff --git a/src/utils_cache.c b/src/utils_cache.c index 79384121..824b7c80 100644 --- a/src/utils_cache.c +++ b/src/utils_cache.c @@ -156,13 +156,12 @@ static int uc_send_notification (const char *name) return (-1); } - snprintf (n.message, sizeof (n.message), + ssnprintf (n.message, sizeof (n.message), "%s has not been updated for %i seconds.", name, (int) (n.time - ce->last_update)); pthread_mutex_unlock (&cache_lock); - n.message[sizeof (n.message) - 1] = '\0'; plugin_dispatch_notification (&n); return (0); @@ -328,7 +327,7 @@ int uc_check_timeout (void) } else { - WARNING ("uc_check_timeout: ut_check_interesting (%s) returned ", + WARNING ("uc_check_timeout: ut_check_interesting (%s) returned " "invalid status %i.", keys[i], status); } @@ -453,10 +452,9 @@ int uc_update (const data_set_t *ds, const value_list_t *vl) n.severity = NOTIF_OKAY; n.time = vl->time; - snprintf (n.message, sizeof (n.message), + ssnprintf (n.message, sizeof (n.message), "Received a value for %s. It was missing for %u seconds.", name, (unsigned int) update_delay); - n.message[sizeof (n.message) - 1] = '\0'; plugin_dispatch_notification (&n); @@ -527,7 +525,7 @@ gauge_t *uc_get_rate (const data_set_t *ds, const value_list_t *vl) if (ret_num != ds->ds_num) { ERROR ("utils_cache: uc_get_rate: ds[%s] has %i values, " - "but uc_get_rate_by_name returned %i.", + "but uc_get_rate_by_name returned %zu.", ds->type, ds->ds_num, ret_num); sfree (ret); return (NULL);