X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fwrite_stackdriver.c;h=46d9aa8cc68ac93778b882d9800c464a1b6020ab;hb=8f6aa6970bf787e6a11e095322af3338ec781d78;hp=fd0192a064aef60da5fa8f87d58ca5a81879dcd2;hpb=839dbf244f96d08c02d18e1fc64264b1740e6fc6;p=collectd.git diff --git a/src/write_stackdriver.c b/src/write_stackdriver.c index fd0192a0..46d9aa8c 100644 --- a/src/write_stackdriver.c +++ b/src/write_stackdriver.c @@ -109,7 +109,7 @@ static char *wg_get_authorization_header(wg_callback_t *cb) { /* {{{ */ return NULL; } - status = snprintf(authorization_header, sizeof(authorization_header), + status = ssnprintf(authorization_header, sizeof(authorization_header), "Authorization: Bearer %s", access_token); if ((status < 1) || ((size_t)status >= sizeof(authorization_header))) return NULL; @@ -160,9 +160,9 @@ static char *api_error_string(api_error_t *err, char *buffer, if (err == NULL) { strncpy(buffer, "Unknown error (API error is NULL)", buffer_size); } else if (err->message == NULL) { - snprintf(buffer, buffer_size, "API error %d", err->code); + ssnprintf(buffer, buffer_size, "API error %d", err->code); } else { - snprintf(buffer, buffer_size, "API error %d: %s", err->code, err->message); + ssnprintf(buffer, buffer_size, "API error %d: %s", err->code, err->message); } return buffer; @@ -251,7 +251,7 @@ static int do_post(wg_callback_t *cb, char const *url, void const *payload, static int wg_call_metricdescriptor_create(wg_callback_t *cb, char const *payload) { char url[1024]; - snprintf(url, sizeof(url), "%s/projects/%s/metricDescriptors", cb->url, + ssnprintf(url, sizeof(url), "%s/projects/%s/metricDescriptors", cb->url, cb->project); wg_memory_t response = {0}; @@ -273,7 +273,7 @@ static int wg_call_metricdescriptor_create(wg_callback_t *cb, static int wg_call_timeseries_write(wg_callback_t *cb, char const *payload) { char url[1024]; - snprintf(url, sizeof(url), "%s/projects/%s/timeSeries", cb->url, cb->project); + ssnprintf(url, sizeof(url), "%s/projects/%s/timeSeries", cb->url, cb->project); wg_memory_t response = {0}; int status = do_post(cb, url, payload, &response);