Merge branch 'rs/simplify-transport-get'

* rs/simplify-transport-get:
  transport: simplify duplicating a substring in transport_get() using xmemdupz()
maint
Junio C Hamano 2015-01-12 11:38:51 -08:00
commit 7a353ec965
1 changed files with 1 additions and 3 deletions

View File

@ -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);
}