aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/security/print_google_default_creds_token.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/security/print_google_default_creds_token.c')
-rw-r--r--test/core/security/print_google_default_creds_token.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/core/security/print_google_default_creds_token.c b/test/core/security/print_google_default_creds_token.c
index a0da5b2d93..73283c2fbd 100644
--- a/test/core/security/print_google_default_creds_token.c
+++ b/test/core/security/print_google_default_creds_token.c
@@ -35,6 +35,7 @@
#include <string.h>
#include "src/core/security/credentials.h"
+#include "src/core/support/string.h"
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
#include <grpc/support/alloc.h>
@@ -56,9 +57,11 @@ static void on_metadata_response(void *user_data,
if (status == GRPC_CREDENTIALS_ERROR) {
fprintf(stderr, "Fetching token failed.\n");
} else {
+ char *token;
GPR_ASSERT(num_md == 1);
- printf("\nGot token: %s\n\n",
- (const char *)GPR_SLICE_START_PTR(md_elems[0].value));
+ token = gpr_dump_slice(md_elems[0].value, GPR_DUMP_ASCII);
+ printf("\nGot token: %s\n\n", token);
+ gpr_free(token);
}
gpr_mu_lock(GRPC_POLLSET_MU(&sync->pollset));
sync->is_done = 1;