Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Jun 2010 04:42:47 +0000 (UTC)
From:      Kevin Lo <kevlo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r209455 - head/share/examples/perfmon
Message-ID:  <201006230442.o5N4glBD059797@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevlo
Date: Wed Jun 23 04:42:47 2010
New Revision: 209455
URL: http://svn.freebsd.org/changeset/base/209455

Log:
  Fix missing argument for errx().
  While here, clean up the code a bit.

Modified:
  head/share/examples/perfmon/perfmon.c

Modified: head/share/examples/perfmon/perfmon.c
==============================================================================
--- head/share/examples/perfmon/perfmon.c	Wed Jun 23 03:59:26 2010	(r209454)
+++ head/share/examples/perfmon/perfmon.c	Wed Jun 23 04:42:47 2010	(r209455)
@@ -173,15 +173,13 @@ getnum(const char *buf, int min, int max
 	l = strtol(buf, &ep, 0);
 	if (*buf && !*ep && !errno) {
 		if (l < min || l > max) {
-			errx(1, "`%s': must be between %d and %d", 
+			errx(1, "%s: must be between %d and %d", 
 			     buf, min, max);
 		}
 		return (int)l;
-	} else if(errno) {
-		errx(1, "`%s': must be between %ld and %ld", 
-		     LONG_MIN, LONG_MAX);
-	}
-	errx(1, "`%s': parameter must be an integer");
+	} 
+
+	errx(1, "%s: parameter must be an integer", buf);
 }
 
 static void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006230442.o5N4glBD059797>