summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2007-09-26 11:06:42 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2007-09-26 11:06:42 +0000
commit153d57e4529429b00a58ccbcc67e450382d53ba5 (patch)
tree9e34d7ca78e14726390787ae7048b16c2d08bbfd
parenteeb90c2746f9db26121625916294e56dbb4c3cd0 (diff)
reuse available var, from Mark Lumsden
-rw-r--r--usr.bin/top/top.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c
index 63f2c3ee6ec..c7ff8923f5b 100644
--- a/usr.bin/top/top.c
+++ b/usr.bin/top/top.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: top.c,v 1.54 2007/09/18 11:15:25 otto Exp $ */
+/* $OpenBSD: top.c,v 1.55 2007/09/26 11:06:41 otto Exp $ */
/*
* Top users/processes display for Unix
@@ -153,15 +153,14 @@ parseargs(int ac, char **av)
break;
case 'p': { /* display only process id */
- unsigned long long num;
const char *errstr;
- num = strtonum(optarg, 0, INT_MAX, &errstr);
- if (errstr != NULL || !find_pid(num)) {
+ i = strtonum(optarg, 0, INT_MAX, &errstr);
+ if (errstr != NULL || !find_pid(i)) {
fprintf(stderr, "%s: unknown pid\n", optarg);
exit(1);
}
- ps.pid = (pid_t)num;
+ ps.pid = (pid_t)i;
ps.system = Yes;
break;
}