NetBSD Problem Report #51188

From www@NetBSD.org  Mon May 30 06:24:30 2016
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 32CB57A46A
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 30 May 2016 06:24:30 +0000 (UTC)
Message-Id: <20160530062429.142E57AB41@mollari.NetBSD.org>
Date: Mon, 30 May 2016 06:24:29 +0000 (UTC)
From: dcb314@hotmail.com
Reply-To: dcb314@hotmail.com
To: gnats-bugs@NetBSD.org
Subject: src/sys/arch/sparc/stand/ofwboot/boot.c: 2 * Redundant condition
X-Send-Pr-Version: www-1.0

>Number:         51188
>Category:       port-sparc
>Synopsis:       src/sys/arch/sparc/stand/ofwboot/boot.c: 2 * Redundant condition
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    martin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 30 06:25:00 +0000 2016
>Closed-Date:    Mon May 30 11:09:06 +0000 2016
>Last-Modified:  Mon May 30 17:05:44 +0000 2016
>Originator:     David Binderman
>Release:        cvs dated 20160529
>Organization:
>Environment:
>Description:
src/sys/arch/sparc/stand/ofwboot/boot.c:144]: (style) Redundant condition: If 'EXPR == ' '', the comparison 'EXPR != 0' is always true.

Source code is

     while (*ap != '\0' && *ap == ' ') {

Suggest new code

    while (*ap == ' ') {

[src/sys/arch/sparc/stand/ofwboot/boot.c:154]: (style) Redundant condition: If 'EXPR == ' '', the comparison 'EXPR != 0' is always true.

Source code is

           while (*ap != '\0' && *ap == ' ') {

Also in the same file

[src/sys/arch/sparc/stand/ofwboot/boot.c:466]: (warning) Obsolete function 'gets' called. It is recommended to use 'fgets' or 'gets_s' instead.

>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: port-sparc-maintainer->martin
Responsible-Changed-By: martin@NetBSD.org
Responsible-Changed-When: Mon, 30 May 2016 11:09:06 +0000
Responsible-Changed-Why:
Take


State-Changed-From-To: open->closed
State-Changed-By: martin@NetBSD.org
State-Changed-When: Mon, 30 May 2016 11:09:06 +0000
State-Changed-Why:
Commited


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51188 CVS commit: src/sys/arch/sparc/stand/ofwboot
Date: Mon, 30 May 2016 10:37:14 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Mon May 30 10:37:14 UTC 2016

 Modified Files:
 	src/sys/arch/sparc/stand/ofwboot: boot.c

 Log Message:
 David Binderman in PR port-sparc/51188: simplify while condition


 To generate a diff of this commit:
 cvs rdiff -u -r1.31 -r1.32 src/sys/arch/sparc/stand/ofwboot/boot.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.