From: René Scharfe Date: Sat, 21 Feb 2015 19:49:58 +0000 (+0100) Subject: connect: use strcmp() for string comparison X-Git-Tag: v2.3.2~2^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2ae7f90f263760abd242501471f123632395d7b3;p=thirdparty%2Fgit.git connect: use strcmp() for string comparison Get rid of magic string length constants and simply compare the strings using strcmp(). This makes the intent of the code a bit clearer. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- diff --git a/connect.c b/connect.c index 5047402a1a..5bff3ed3f2 100644 --- a/connect.c +++ b/connect.c @@ -161,8 +161,7 @@ struct ref **get_remote_heads(int in, char *src_buf, size_t src_len, server_capabilities = xstrdup(name + name_len + 1); } - if (extra_have && - name_len == 5 && !memcmp(".have", name, 5)) { + if (extra_have && !strcmp(name, ".have")) { sha1_array_append(extra_have, old_sha1); continue; }