diff options
author | Ben Straub <bs@github.com> | 2013-02-01 22:00:55 +0400 |
---|---|---|
committer | Ben Straub <bs@github.com> | 2013-02-01 22:00:55 +0400 |
commit | c4beee768135f70b91b2c0bfa1dbc99a58c1f311 (patch) | |
tree | 43a721f7b4147b016ce7d8dc37d3a987839374dd /src/netops.c | |
parent | 8c36a3cdba57ce5fb81d81dc3186f3ff9f2702f7 (diff) |
Introduce git__substrdup
Diffstat (limited to 'src/netops.c')
-rw-r--r-- | src/netops.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/netops.c b/src/netops.c index fd788bc1d..cc94d0350 100644 --- a/src/netops.c +++ b/src/netops.c @@ -606,26 +606,26 @@ int gitno_extract_url_parts( start = url; if (at && at < slash) { start = at+1; - *username = git__strndup(url, at - url); + *username = git__substrdup(url, at - url); } if (colon && colon < at) { git__free(*username); - *username = git__strndup(url, colon-url); - *password = git__strndup(colon+1, at-colon-1); + *username = git__substrdup(url, colon-url); + *password = git__substrdup(colon+1, at-colon-1); colon = strchr(at, ':'); } if (colon == NULL) { *port = git__strdup(default_port); } else { - *port = git__strndup(colon + 1, slash - colon - 1); + *port = git__substrdup(colon + 1, slash - colon - 1); } GITERR_CHECK_ALLOC(*port); end = colon == NULL ? slash : colon; - *host = git__strndup(start, end - start); + *host = git__substrdup(start, end - start); GITERR_CHECK_ALLOC(*host); return 0; |