From: DJ Delorie <dj@redhat.com>
To: qinwei@sunnorth.com.cn
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] libiberty/vasprintf.c bug
Date: Fri, 23 Mar 2007 03:45:00 -0000 [thread overview]
Message-ID: <200703230345.l2N3jdLu002570@greed.delorie.com> (raw)
In-Reply-To: <OFE8DB7B6F.2C137A3A-ON482572A7.000EB49B-482572A7.000F0BA3@sunnorth.com.cn> (message from qinwei on Fri, 23 Mar 2007 10:44:20 +0800)
> > If ptr is NULL, shouldn't we add strlen("(null)") ?
>
> Yes. This will cause error.
> const char *p = NULL;
> int i = strlen (p);
I understand that. My question was, if you printf("%s", NULL), what
happens? If it prints "(null)", does that mean you need to account
for the length of that string in your calculations?
(also, note that libiberty patches go to gcc-patches@gcc.gnu.org, in
addition to any other lists who might be interested)
prev parent reply other threads:[~2007-03-23 3:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-22 8:15 qinwei
2007-03-22 18:16 ` DJ Delorie
2007-03-23 2:44 ` qinwei
2007-03-23 3:45 ` DJ Delorie [this message]
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=200703230345.l2N3jdLu002570@greed.delorie.com \
--to=dj@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=qinwei@sunnorth.com.cn \
/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