From: Junio C Hamano Date: Sat, 08 Jul 2017 22:29:00 GMT Subject: Re: [PATCH] apply: use strcmp(3) for comparing strings in gitdiff_verify_name() Message-ID: In-Reply-To: <8bd7c4c6-c545-723b-ec4b-262abd8a7f5f@web.de> René Scharfe writes: > Am 08.07.2017 um 13:08 schrieb Ramsay Jones: >> On 08/07/17 09:58, René Scharfe wrote: >>> Avoid running over the end of another -- a C string whose length we >>> don't know -- by using strcmp(3) instead of memcmp(3) for comparing it >>> with another C string. >> >> I had to read this twice, along with the patch text, before this >> made any sense. ;-) The missing information being that 'another' >> was the name of the string variable that we were potentially >> 'running over the end of'. > > Yeah, sorry, encasing that unusual variable name in quotes would > probably have helped. What makes it even more confusing is that the variable with the problematic name is referred to as "it" in the last part of the description--- the second occurrence of 'another' is actually not referring to that variable but yet another string that is being compared with it ;-)