From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7347 invoked by alias); 19 Apr 2011 14:02:25 -0000 Received: (qmail 7335 invoked by uid 22791); 19 Apr 2011 14:02:24 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 19 Apr 2011 14:01:54 +0000 Received: (qmail 22554 invoked from network); 19 Apr 2011 14:01:54 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 19 Apr 2011 14:01:54 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [RFA] ARI fix: avoid assignment in if clause in xcoffread.c Date: Tue, 19 Apr 2011 14:02:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-28-generic; KDE/4.6.2; x86_64; ; ) Cc: "Pierre Muller" References: <000901cbfe97$9ed7f120$dc87d360$@muller@ics-cnrs.unistra.fr> In-Reply-To: <000901cbfe97$9ed7f120$dc87d360$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201104191501.53552.pedro@codesourcery.com> 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: 2011-04/txt/msg00322.txt.bz2 On Tuesday 19 April 2011 14:42:25, Pierre Muller wrote: > If I understand the code correctly, this patch > should have no effect, the only thing that could have is > an unnecessary call to strchr. > The other alternative would be to > do a > + if (*name == ':') > + retrun NULL; > + pp = (char *) strchr (name, ':'); > + if (pp == NULL) > would that be better? Yes, okay with that change. -- Pedro Alves