Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
transport: simplify duplicating a substring in transport_get() using xmemdupz()
author
René Scharfe
<l.s.r@web.de>
Wed, 24 Dec 2014 00:18:31 +0000
(
01:18
+0100)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 29 Dec 2014 17:39:23 +0000
(09:39 -0800)
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>
transport.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
c2e8e4b
)
diff --git
a/transport.c
b/transport.c
index 70d38e4c4b35c6207e226ab7cb54095c34bb4766..08bcd3a4eba42d2e72b9d84ec89e190c763300fa 100644
(file)
--- a/
transport.c
+++ b/
transport.c
@@
-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);
}