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
/
utils
/
oauth
/
oauth.c
diff --git
a/src/utils/oauth/oauth.c
b/src/utils/oauth/oauth.c
index
4b31056
..
b7b1978
100644
(file)
--- a/
src/utils/oauth/oauth.c
+++ b/
src/utils/oauth/oauth.c
@@
-184,7
+184,7
@@
static int get_claim(oauth_t *auth, char *buffer, size_t buffer_size) /* {{{ */
/* create the claim set */
status =
/* create the claim set */
status =
- snprintf(claim, sizeof(claim), OAUTH_CLAIM_FORMAT, auth->iss, auth->scope,
+ s
s
nprintf(claim, sizeof(claim), OAUTH_CLAIM_FORMAT, auth->iss, auth->scope,
auth->aud, (unsigned long)CDTIME_T_TO_TIME_T(exp),
(unsigned long)CDTIME_T_TO_TIME_T(iat));
if (status < 1)
auth->aud, (unsigned long)CDTIME_T_TO_TIME_T(exp),
(unsigned long)CDTIME_T_TO_TIME_T(iat));
if (status < 1)
@@
-209,7
+209,7
@@
static int get_signature(char *buffer, size_t buffer_size, /* {{{ */
int status;
/* Make the string to sign */
int status;
/* Make the string to sign */
- payload_len = snprintf(payload, sizeof(payload), "%s.%s", header, claim);
+ payload_len = s
s
nprintf(payload, sizeof(payload), "%s.%s", header, claim);
if (payload_len < 1) {
return -1;
} else if (payload_len >= sizeof(payload)) {
if (payload_len < 1) {
return -1;
} else if (payload_len >= sizeof(payload)) {
@@
-277,7
+277,7
@@
static int get_assertion(oauth_t *auth, char *buffer,
if (status != 0)
return -1;
if (status != 0)
return -1;
- status = snprintf(buffer, buffer_size, "%s.%s.%s", header, claim, signature);
+ status = s
s
nprintf(buffer, buffer_size, "%s.%s.%s", header, claim, signature);
if (status < 1)
return -1;
else if ((size_t)status >= buffer_size)
if (status < 1)
return -1;
else if ((size_t)status >= buffer_size)
@@
-350,7
+350,7
@@
static int new_token(oauth_t *auth) /* {{{ */
return -1;
}
return -1;
}
- snprintf(post_data, sizeof(post_data), "grant_type=%s&assertion=%s",
+ s
s
nprintf(post_data, sizeof(post_data), "grant_type=%s&assertion=%s",
OAUTH_GRANT_TYPE, assertion);
curl = curl_easy_init();
OAUTH_GRANT_TYPE, assertion);
curl = curl_easy_init();
@@
-589,7
+589,7
@@
oauth_google_t oauth_create_google_default(char const *scope) {
char const *home;
if ((home = getenv("HOME")) != NULL) {
char path[PATH_MAX];
char const *home;
if ((home = getenv("HOME")) != NULL) {
char path[PATH_MAX];
- snprintf(path, sizeof(path),
+ s
s
nprintf(path, sizeof(path),
"%s/.config/gcloud/application_default_credentials.json", home);
oauth_google_t ret = oauth_create_google_file(path, scope);
"%s/.config/gcloud/application_default_credentials.json", home);
oauth_google_t ret = oauth_create_google_file(path, scope);