From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:48407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ruh7E-0008Af-4s for qemu-devel@nongnu.org; Tue, 07 Feb 2012 04:13:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ruh7D-0002wP-5u for qemu-devel@nongnu.org; Tue, 07 Feb 2012 04:13:32 -0500 Received: from mail-pz0-f45.google.com ([209.85.210.45]:63959) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ruh7C-0002wK-T6 for qemu-devel@nongnu.org; Tue, 07 Feb 2012 04:13:31 -0500 Received: by dadp14 with SMTP id p14so7386467dad.4 for ; Tue, 07 Feb 2012 01:13:30 -0800 (PST) Sender: Paolo Bonzini Message-ID: <4F30EB32.3020607@redhat.com> Date: Tue, 07 Feb 2012 10:13:22 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1328342577-25732-1-git-send-email-pbonzini@redhat.com> <1328342577-25732-9-git-send-email-pbonzini@redhat.com> <4F2FE185.1060301@codemonkey.ws> In-Reply-To: <4F2FE185.1060301@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 08/27] qom: fix off-by-one List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org On 02/06/2012 03:19 PM, Anthony Liguori wrote: >> >> target_type = g_strdup(&type[5]); >> - target_type[strlen(target_type) - 2] = 0; >> + *strchr(target_type, '>') = 0; > > Should use an intermediate variable here and do a NULL check. > > My eyes can't handle dereferencing strchr() directly even if I > understand why it's safe to do :-) Ok, I'll change to strrchr too since I have to respin. Paolo