transport: simplify duplicating a substring in transport_get() using xmemdupz()
Signed-off-by: Rene Scharfe <l.s.r@web.de> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
c2e8e4b9da
commit
6b33894f99
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user