NetBSD Problem Report #24008

Received: (qmail 27168 invoked by uid 605); 6 Jan 2004 20:26:56 -0000
Message-Id: <20040106202655.09CA911153@narn.netbsd.org>
Date: Tue,  6 Jan 2004 20:26:55 +0000 (UTC)
From: jeffi@rcn.com
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: jeffi@rcn.com
To: gnats-bugs@gnats.NetBSD.org
Subject: incorrect macro in ndbootd header
X-Send-Pr-Version: www-1.0

>Number:         24008
>Category:       bin
>Synopsis:       incorrect macro in ndbootd header
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 06 20:27:00 +0000 2004
>Closed-Date:    Tue Jan 06 23:03:11 +0000 2004
>Last-Modified:  Tue Jan 06 23:04:00 +0000 2004
>Originator:     Jeff Ito
>Release:        1.6ZG
>Organization:
>Environment:
1.6ZG
>Description:
In ndbootd.h MAX is defined as
#define MAX(a, b) ((a) < (b) ? (a) : (b))
of course it should read
#define MAX(a, b) ((a) > (b) ? (a) : (b))

MAX is never used in code, MIN however is. So the macro should be removed, or corrected.
>How-To-Repeat:
N/A
>Fix:
Index: ndbootd.h
===================================================================
RCS file: /cvs/nbsd/src/usr.sbin/ndbootd/ndbootd.h,v
retrieving revision 1.4
diff -u -r1.4 ndbootd.h
--- ndbootd.h   17 Aug 2003 22:34:17 -0000      1.4
+++ ndbootd.h   6 Jan 2004 20:01:01 -0000
@@ -102,7 +102,7 @@
 #define strerror(e) ((e) < sys_nerr ? sys_errlist[e] : "unknown error")
 #endif                         /* !HAVE_STRERROR */
 #ifndef MAX
-#define MAX(a, b) ((a) < (b) ? (a) : (b))
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
 #endif                         /* !MAX */
 #ifndef MIN
 #define MIN(a, b) ((a) < (b) ? (a) : (b))

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: wiz 
State-Changed-When: Tue Jan 6 23:03:04 UTC 2004 
State-Changed-Why:  
Fixed, thanks. 

From: Thomas Klausner <wiz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:  
Subject: pr/24008 CVS commit: src/usr.sbin/ndbootd
Date: Tue,  6 Jan 2004 23:02:55 +0000 (UTC)

 Module Name:	src
 Committed By:	wiz
 Date:		Tue Jan  6 23:02:55 UTC 2004

 Modified Files:
 	src/usr.sbin/ndbootd: ndbootd.h

 Log Message:
 Fix MAX macro; from Jeff Ito in PR 24008.


 To generate a diff of this commit:
 cvs rdiff -r1.4 -r1.5 src/usr.sbin/ndbootd/ndbootd.h

 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.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.