projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add snprintf wrapper for GCC 8.2/3
[collectd.git]
/
src
/
write_stackdriver.c
diff --git
a/src/write_stackdriver.c
b/src/write_stackdriver.c
index
fd0192a
..
46d9aa8
100644
(file)
--- 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;
}
return NULL;
}
- status = snprintf(authorization_header, sizeof(authorization_header),
+ status = s
s
nprintf(authorization_header, sizeof(authorization_header),
"Authorization: Bearer %s", access_token);
if ((status < 1) || ((size_t)status >= sizeof(authorization_header)))
return NULL;
"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) {
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);
+ s
s
nprintf(buffer, buffer_size, "API error %d", err->code);
} else {
} else {
- snprintf(buffer, buffer_size, "API error %d: %s", err->code, err->message);
+ s
s
nprintf(buffer, buffer_size, "API error %d: %s", err->code, err->message);
}
return buffer;
}
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];
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,
+ s
s
nprintf(url, sizeof(url), "%s/projects/%s/metricDescriptors", cb->url,
cb->project);
wg_memory_t response = {0};
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];
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);
+ s
s
nprintf(url, sizeof(url), "%s/projects/%s/timeSeries", cb->url, cb->project);
wg_memory_t response = {0};
int status = do_post(cb, url, payload, &response);
wg_memory_t response = {0};
int status = do_post(cb, url, payload, &response);