This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Show some tips when file cmd get bfd_error_file_ambiguously_recognized
On Thu, Jan 28, 2010 at 1:56 PM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
> On Wed, 27 Jan 2010 10:00:34 +0100, Hui Zhu wrote:
>> + ?ret_len = strlen (bfd_errmsg (error_tag)) + strlen (AMBIGUOUS_MESS1)
>> + ? ? ? ? + 50 + strlen (AMBIGUOUS_MESS2);
>> + ?ret = xmalloc (ret_len + 1);
>
> Rather than all the C strings manipulation fragile magic maybe one could
> afford mem_fileopen with ui_file_xstrdup (as being done sometimes in GDB).
Fine with me.
[I've always lamented the absence of such a facility in C itself.]