From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Sun, 6 Dec 2015 17:06:00 -0500 Subject: [U-Boot] [U-Boot,RFC] common: cli_hush: avoid dead code In-Reply-To: <1448355263-545-2-git-send-email-Peng.Fan@freescale.com> References: <1448355263-545-2-git-send-email-Peng.Fan@freescale.com> Message-ID: <20151206220600.GD9551@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, Nov 24, 2015 at 04:54:21PM +0800, Peng Fan wrote: > Condition "(value == NULL && ++value == NULL)" actully will > always return false. > > Instead, use condition "(value == NULL || *(value + 1) == 0)" to detect > such expression "c=". To "c=", *(value + 1) is 0, so directly return -1, > but not continue. > > Signed-off-by: Peng Fan > Cc: Rabin Vincent > Cc: Simon Glass > Cc: Tom Rini > Reviewed-by: Simon Glass Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: