diff options
author | yang-g <yangg@google.com> | 2015-07-07 23:33:40 -0700 |
---|---|---|
committer | yang-g <yangg@google.com> | 2015-07-07 23:33:40 -0700 |
commit | ab575d46f73f4e11a243fb6b5dfa0ef748447727 (patch) | |
tree | 822514f345fa29bdbe7d26965871e7c62578cc12 /test/core/security | |
parent | 6406f1826739048ceac9e43afe0761ebf8b12ed7 (diff) | |
parent | 3b685b744818ec73580aff961f85c22b11e61ab0 (diff) |
merge head and resolve conflict
Diffstat (limited to 'test/core/security')
-rw-r--r-- | test/core/security/print_google_default_creds_token.c | 7 |
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; |