From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15688 invoked by alias); 28 Jan 2010 21:59:55 -0000 Received: (qmail 15680 invoked by uid 22791); 28 Jan 2010 21:59:54 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 28 Jan 2010 21:59:51 +0000 Received: from kpbe18.cbf.corp.google.com (kpbe18.cbf.corp.google.com [172.25.105.82]) by smtp-out.google.com with ESMTP id o0SLxl22000668 for ; Thu, 28 Jan 2010 21:59:47 GMT Received: from wwb18 (wwb18.prod.google.com [10.241.241.82]) by kpbe18.cbf.corp.google.com with ESMTP id o0SLxhBL003543 for ; Thu, 28 Jan 2010 13:59:44 -0800 Received: by wwb18 with SMTP id 18so55128wwb.15 for ; Thu, 28 Jan 2010 13:59:43 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.91.10 with SMTP id g10mr2511598wef.217.1264715983645; Thu, 28 Jan 2010 13:59:43 -0800 (PST) In-Reply-To: <20100128215609.GA31654@host0.dyn.jankratochvil.net> References: <20100114101348.GA24756@host0.dyn.jankratochvil.net> <20100119075642.GA30154@host0.dyn.jankratochvil.net> <20100128215609.GA31654@host0.dyn.jankratochvil.net> Date: Thu, 28 Jan 2010 21:59:00 -0000 Message-ID: Subject: Re: [RFA] Show some tips when file cmd get bfd_error_file_ambiguously_recognized From: Doug Evans To: Jan Kratochvil Cc: Hui Zhu , gdb-patches ml , Tristan Gingold , Daniel Jacobowitz Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-01/txt/msg00620.txt.bz2 On Thu, Jan 28, 2010 at 1:56 PM, Jan Kratochvil wrote: > On Wed, 27 Jan 2010 10:00:34 +0100, Hui Zhu wrote: >> + =A0ret_len =3D strlen (bfd_errmsg (error_tag)) + strlen (AMBIGUOUS_MES= S1) >> + =A0 =A0 =A0 =A0 + 50 + strlen (AMBIGUOUS_MESS2); >> + =A0ret =3D 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.]