aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/support/host_port.cc
diff options
context:
space:
mode:
authorGravatar Yash Tibrewal <yashkt@google.com>2017-11-09 17:46:29 -0800
committerGravatar Yash Tibrewal <yashkt@google.com>2017-11-09 17:46:29 -0800
commit4e9265c828f0b559b5fdba04913fed46bf771399 (patch)
tree4a379fc2bdc037753cf8d81f8b86327e4bc50a42 /src/core/lib/support/host_port.cc
parent0ee7574732a06e8cace4e099a678f4bd5dbff679 (diff)
parentd9da7387b8057f3bd99a417a5ee905377bce9296 (diff)
Merge with master
Diffstat (limited to 'src/core/lib/support/host_port.cc')
-rw-r--r--src/core/lib/support/host_port.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core/lib/support/host_port.cc b/src/core/lib/support/host_port.cc
index 3302e574ab..1927d5507d 100644
--- a/src/core/lib/support/host_port.cc
+++ b/src/core/lib/support/host_port.cc
@@ -25,7 +25,7 @@
#include <grpc/support/string_util.h>
#include "src/core/lib/support/string.h"
-int gpr_join_host_port(char **out, const char *host, int port) {
+int gpr_join_host_port(char** out, const char* host, int port) {
if (host[0] != '[' && strchr(host, ':') != NULL) {
/* IPv6 literals must be enclosed in brackets. */
return gpr_asprintf(out, "[%s]:%d", host, port);
@@ -35,17 +35,17 @@ int gpr_join_host_port(char **out, const char *host, int port) {
}
}
-int gpr_split_host_port(const char *name, char **host, char **port) {
- const char *host_start;
+int gpr_split_host_port(const char* name, char** host, char** port) {
+ const char* host_start;
size_t host_len;
- const char *port_start;
+ const char* port_start;
*host = NULL;
*port = NULL;
if (name[0] == '[') {
/* Parse a bracketed host, typically an IPv6 literal. */
- const char *rbracket = strchr(name, ']');
+ const char* rbracket = strchr(name, ']');
if (rbracket == NULL) {
/* Unmatched [ */
return 0;
@@ -68,7 +68,7 @@ int gpr_split_host_port(const char *name, char **host, char **port) {
return 0;
}
} else {
- const char *colon = strchr(name, ':');
+ const char* colon = strchr(name, ':');
if (colon != NULL && strchr(colon + 1, ':') == NULL) {
/* Exactly 1 colon. Split into host:port. */
host_start = name;
@@ -83,7 +83,7 @@ int gpr_split_host_port(const char *name, char **host, char **port) {
}
/* Allocate return values. */
- *host = (char *)gpr_malloc(host_len + 1);
+ *host = (char*)gpr_malloc(host_len + 1);
memcpy(*host, host_start, host_len);
(*host)[host_len] = '\0';