On Monday 31 July 2006 17:00, Vladimir Prus wrote: > On Friday 21 July 2006 19:20, Eli Zaretskii wrote: > > > 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. > > Here's a patch that does exactly that, and is also based on the current > mainline (and so uses target_read_stralloc). Sorry, that patch included some extra changes and did not include some neede ones. This one is correct. - Volodya