From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6289 invoked by alias); 21 Jul 2006 15:20:31 -0000 Received: (qmail 6280 invoked by uid 22791); 21 Jul 2006 15:20:30 -0000 X-Spam-Check-By: sourceware.org Received: from nitzan.inter.net.il (HELO nitzan.inter.net.il) (192.114.186.20) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 21 Jul 2006 15:20:24 +0000 Received: from HOME-C4E4A596F7 (IGLD-80-230-200-39.inter.net.il [80.230.200.39]) by nitzan.inter.net.il (MOS 3.7.3-GA) with ESMTP id EFR42799 (AUTH halo1); Fri, 21 Jul 2006 18:20:19 +0300 (IDT) Date: Fri, 21 Jul 2006 15:20:00 -0000 Message-Id: From: Eli Zaretskii To: Vladimir Prus CC: gdb-patches@sources.redhat.com In-reply-to: <200607211535.30236.vladimir@codesourcery.com> (message from Vladimir Prus on Fri, 21 Jul 2006 15:35:29 +0400) Subject: Re: Flash support part 1: memory maps Reply-to: Eli Zaretskii References: <200607201341.34070.vladimir@codesourcery.com> <200607211535.30236.vladimir@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-07/txt/msg00294.txt.bz2 > From: Vladimir Prus > 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.