Use starts_with() for C strings instead of memcmp()
commit50e19a83585bd1aeae6aa01d31e5f783b7ef8b1b
authorRené Scharfe <l.s.r@web.de>
Fri, 6 Jun 2014 17:24:48 +0000 (6 19:24 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 Jun 2014 21:38:12 +0000 (9 14:38 -0700)
tree37c4a5fad81436a9afc07e87486a26ec8b0b9e9b
parentbce14aa132e0064d9a9b1c7ad98e71e22c6e0272
Use starts_with() for C strings instead of memcmp()

Convert three cases of checking for a constant prefix using memcmp() to
starts_with().  This way there is no need for magic string length
constants and we avoid running over the end of the string should it be
shorter than the prefix.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/for-each-ref.c
fetch-pack.c
remote.c