Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Vladimir Prus <vladimir@codesourcery.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: Flash support part 1: memory maps
Date: Fri, 21 Jul 2006 15:20:00 -0000	[thread overview]
Message-ID: <uhd1bgf2m.fsf@gnu.org> (raw)
In-Reply-To: <200607211535.30236.vladimir@codesourcery.com> (message from 	Vladimir Prus on Fri, 21 Jul 2006 15:35:29 +0400)

> From: Vladimir Prus <vladimir@codesourcery.com>
> Date: Fri, 21 Jul 2006 15:35:29 +0400
> Cc: gdb-patches@sources.redhat.com
> 
> > > +  if (!data->character_data)
> > > +    data->character_data = (char *)malloc (len + 1);
> > > +  else
> > > +    {
> > > +      current_size = strlen (data->character_data);
> > > +      data->character_data = (char *)realloc (data->character_data,
> > > +                                              current_size + len + 1);
> >
> > Why do we need to cast the results of malloc and realloc?
> 
> Ah, yea, we don't need this in C.

In fact, I think you should replace these with xmalloc and xrealloc.


  reply	other threads:[~2006-07-21 15:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-20  9:41 Vladimir Prus
2006-07-20 19:32 ` Eli Zaretskii
2006-07-21 11:35   ` Vladimir Prus
2006-07-21 15:20     ` Eli Zaretskii [this message]
2006-07-31 13:00       ` Vladimir Prus
2006-07-31 13:20         ` Vladimir Prus
2006-07-31 22:09           ` Mark Kettenis
2006-08-01  0:53             ` Daniel Jacobowitz
2006-08-01  5:11             ` Vladimir Prus
2006-08-16 20:05 ` Daniel Jacobowitz
2006-09-21 13:56   ` Daniel Jacobowitz

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=uhd1bgf2m.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=vladimir@codesourcery.com \
    /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