From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHtB9-0008DK-Rc for qemu-devel@nongnu.org; Sat, 09 Jan 2016 08:03:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aHtB4-0001ed-TG for qemu-devel@nongnu.org; Sat, 09 Jan 2016 08:03:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54796) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHtB4-0001eM-NY for qemu-devel@nongnu.org; Sat, 09 Jan 2016 08:03:30 -0500 Date: Sat, 9 Jan 2016 18:33:21 +0530 (IST) From: P J P In-Reply-To: <1907860725.4.388b58e8-5b06-4844-be0c-df2778eb46fb.open-xchange@webmail.proxmox.com> Message-ID: References: <20160108091949.GA14724@olga> <20160108130251.GA17847@olga> <20160108143831.GA7632@olga> <1907860725.4.388b58e8-5b06-4844-be0c-df2778eb46fb.open-xchange@webmail.proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Subject: Re: [Qemu-devel] [PATCH] hmp: avoid redundant null termination of buffer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wolfgang Bumiller Cc: qemu-devel@nongnu.org, Ling Liu +-- On Sat, 9 Jan 2016, Wolfgang Bumiller wrote --+ | > could say: if (!strcmp(keyname_buf, "<")). | | keyname_len+1 (size instead of length) to include the \0, then yes I think | strcmp can be used this way. The +1 should be fine there (since >= covers | it). Yes, right. -- - P J P 47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F