From 3b2cb2c91ee77e5e45957e8355025e3e742c07bd Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Tue, 16 Sep 2014 11:49:25 +0200 Subject: Factor 40 and 41 constants from source. --- src/transports/smart_protocol.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/transports') diff --git a/src/transports/smart_protocol.c b/src/transports/smart_protocol.c index 5ca5065ac..7c20382dc 100644 --- a/src/transports/smart_protocol.c +++ b/src/transports/smart_protocol.c @@ -640,9 +640,9 @@ static int gen_pktline(git_buf *buf, git_push *push) { push_spec *spec; size_t i, len; - char old_id[41], new_id[41]; + char old_id[GIT_OID_HEXSZ+1], new_id[GIT_OID_HEXSZ+1]; - old_id[40] = '\0'; new_id[40] = '\0'; + old_id[GIT_OID_HEXSZ] = '\0'; new_id[GIT_OID_HEXSZ] = '\0'; git_vector_foreach(&push->specs, i, spec) { len = 2*GIT_OID_HEXSZ + 7 + strlen(spec->rref); @@ -963,7 +963,7 @@ int git_smart__push(git_transport *transport, git_push *push) #ifdef PUSH_DEBUG { git_remote_head *head; - char hex[41]; hex[40] = '\0'; + char hex[GIT_OID_HEXSZ+1]; hex[GIT_OID_HEXSZ] = '\0'; git_vector_foreach(&push->remote->refs, i, head) { git_oid_fmt(hex, &head->oid); -- cgit v1.2.1