From: "Dmitry V. Levin" <ldv@altlinux•org>
To: git@vger•kernel.org
Subject: Q: xasprintf
Date: Tue, 23 May 2006 15:28:54 +0400 [thread overview]
Message-ID: <20060523112854.GD5582@basalt.office.altlinux.org> (raw)
In-Reply-To: <7vzmh98seo.fsf@assigned-by-dhcp.cox.net>
[-- Attachment #1: Type: text/plain, Size: 519 bytes --]
Hi,
On Mon, May 22, 2006 at 06:02:39PM -0700, Junio C Hamano wrote:
> Sean <seanlkml@sympatico•ca> writes:
[...]
> > - name = xmalloc(len_a + len_b - pfx_length - sfx_length + 7);
> > + name = xmalloc(pfx_length + a_midlen + b_midlen + sfx_length + 7);
> > sprintf(name, "%.*s{%.*s => %.*s}%s",
>
> Obviously correct given what the sprintf() that immediately
> follows does. Sheesh, what was I smoking back then. *BLUSH*
What about introducing xasprintf() to eliminate such issues?
--
ldv
[-- Attachment #2: Type: application/pgp-signature, Size: 191 bytes --]
next prev parent reply other threads:[~2006-05-23 11:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-22 23:09 git-diff-tree crashes on ubuntu kernel git repository Torgil Svensson
[not found] ` <20060522203634.2f7b0613.seanlkml@sympatico.ca>
2006-05-23 0:36 ` [PATCH] Avoid segfault in diff --stat rename output Sean
2006-05-23 1:02 ` Junio C Hamano
2006-05-23 11:28 ` Dmitry V. Levin [this message]
2006-05-23 19:06 ` Torgil Svensson
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=20060523112854.GD5582@basalt.office.altlinux.org \
--to=ldv@altlinux$(echo .)org \
--cc=git@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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