/* create the claim set */
status =
- snprintf(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));
+ ssnprintf(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)
return -1;
else if ((size_t)status >= sizeof(claim))
int status;
/* Make the string to sign */
- payload_len = snprintf(payload, sizeof(payload), "%s.%s", header, claim);
+ payload_len = ssnprintf(payload, sizeof(payload), "%s.%s", header, claim);
if (payload_len < 1) {
return -1;
} else if (payload_len >= sizeof(payload)) {
if (status != 0)
return -1;
- status = snprintf(buffer, buffer_size, "%s.%s.%s", header, claim, signature);
+ status = ssnprintf(buffer, buffer_size, "%s.%s.%s", header, claim, signature);
if (status < 1)
return -1;
else if ((size_t)status >= buffer_size)
return -1;
}
- snprintf(post_data, sizeof(post_data), "grant_type=%s&assertion=%s",
- OAUTH_GRANT_TYPE, assertion);
+ ssnprintf(post_data, sizeof(post_data), "grant_type=%s&assertion=%s",
+ OAUTH_GRANT_TYPE, assertion);
curl = curl_easy_init();
if (curl == NULL) {
}
oauth_google_t ret = {
- .project_id = strdup(project_id), .oauth = oauth,
+ .project_id = strdup(project_id),
+ .oauth = oauth,
};
yajl_tree_free(root);
char const *home;
if ((home = getenv("HOME")) != NULL) {
char path[PATH_MAX];
- snprintf(path, sizeof(path),
- "%s/.config/gcloud/application_default_credentials.json", home);
+ ssnprintf(path, sizeof(path),
+ "%s/.config/gcloud/application_default_credentials.json", home);
oauth_google_t ret = oauth_create_google_file(path, scope);
if (ret.oauth != NULL) {