Skip to content

Commit

Permalink
Merge branch 'rs/simplify-transport-get'
Browse files Browse the repository at this point in the history
* rs/simplify-transport-get:
  transport: simplify duplicating a substring in transport_get() using xmemdupz()
  • Loading branch information
Junio C Hamano committed Jan 12, 2015
2 parents acddf49 + 6b33894 commit 7a353ec
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -971,9 +971,7 @@ struct transport *transport_get(struct remote *remote, const char *url)
} else {
/* Unknown protocol in URL. Pass to external handler. */
int len = external_specification_len(url);
char *handler = xmalloc(len + 1);
handler[len] = 0;
strncpy(handler, url, len);
char *handler = xmemdupz(url, len);
transport_helper_init(ret, handler);
}

Expand Down

0 comments on commit 7a353ec

Please sign in to comment.