Re: [PATCH] Add git-imap-send.
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Mar 9, 2006, 11:44 UTC
- Message-ID
- <Pine.LNX.4.63.0603091243001.20908@wbgn013.biozentrum.uni-wuerzburg.de>
- In-Reply-To
- <4410140E.2000609@op5.se>
Hi,
On Thu, 9 Mar 2006, Andreas Ericsson wrote:
Show 21 quoted lines
> Johannes Schindelin wrote:
> > Hi,
> >
> > On Thu, 9 Mar 2006, Junio C Hamano wrote:
> >
> >
> > > Mike McCormack <mike@codeweavers.com> writes:
> > >
> > >
> > > > + if (!memcmp( "imaps:", val, 6 )) {
> > > > + if (!memcmp( "imap:", val, 5 ))
> > >
> > > Is val always longer than 5 or 6 bytes here?
> >
> >
> > That does not matter, since they are strings, and the memcmp should not look
> > further if they are shorter (because the comparison to '\0' failed already).
> >
>
> That's what strcmp() does. memcmp() walks the lenghth even if it encounters
> nul bytes. Perhaps you confuse it with strncmp()?Sorry, I was unclear. Of course, memcmp() does not stop on NUL. But it stops when that NUL is different from what the other pointer has. Which is the case here.
Ciao, Dscho