From 258c09af47be30342dc7fb0f4892a262a3d30ff6 Mon Sep 17 00:00:00 2001 From: Kevin Lo Date: Wed, 23 Jun 2010 04:42:47 +0000 Subject: [PATCH] Fix missing argument for errx(). While here, clean up the code a bit. --- share/examples/perfmon/perfmon.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/share/examples/perfmon/perfmon.c b/share/examples/perfmon/perfmon.c index 34e38849b22b..edac9bd857aa 100644 --- a/share/examples/perfmon/perfmon.c +++ b/share/examples/perfmon/perfmon.c @@ -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