Git development
 help / color / mirror / Atom feed
From: Jan Andres <jandres@gmx.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Fix typo in http-push.c
Date: Tue, 29 Nov 2005 14:35:37 +0100	[thread overview]
Message-ID: <20051129133537.GA490@pitr.home.jan> (raw)
In-Reply-To: <Pine.LNX.4.63.0511290923390.16927@wbgn013.biozentrum.uni-wuerzburg.de>

Hi,

On Tue, 29. Nov. 2005 at 09:24:47 +0100, Johannes Schindelin wrote:
> Hi,
> 
> On Tue, 29 Nov 2005, Jan Andres wrote:
> 
> > -				lock->token = xmalloc(strlen(ctx->cdata - 15));
> > +				lock->token = xmalloc(strlen(ctx->cdata) - 15);
> >  				strcpy(lock->token, ctx->cdata + 16);
> 
> Why not
> 
> +				lock->token = xmalloc(strlen(ctx->cdata + 16));

Looks more efficient indeed, but wouldn't we have to use

+				lock->token = xmalloc(strlen(ctx->cdata + 16) + 1);

so as to account for the trailing NUL?

Regards
-- 
Jan Andres <jandres@gmx.net>

  reply	other threads:[~2005-11-29 13:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-29  0:51 [PATCH] Fix typo in http-push.c Jan Andres
2005-11-29  6:03 ` Junio C Hamano
2005-11-29  8:24 ` Johannes Schindelin
2005-11-29 13:35   ` Jan Andres [this message]
2005-11-29 15:30     ` [PATCH] Fix typo in http-push.c, take two Jan Andres
2005-11-29 16:40     ` [PATCH] Fix typo in http-push.c Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051129133537.GA490@pitr.home.jan \
    --to=jandres@gmx.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox