summaryrefslogtreecommitdiff
path: root/usr.bin/pmdb
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2002-03-19 23:17:59 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2002-03-19 23:17:59 +0000
commitef3e143b94911f849e21e17b68643aa6569cbfac (patch)
tree7b393520e5d6a88cac0dc0f3a68943bb7e0d9259 /usr.bin/pmdb
parentdac3fe9a6b9c3ab013c83ce20ac4fee92d720259 (diff)
o don't need a var to keep the number of commands; use a define.
o remove extra arg after dale commit.
Diffstat (limited to 'usr.bin/pmdb')
-rw-r--r--usr.bin/pmdb/pmdb.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/pmdb/pmdb.c b/usr.bin/pmdb/pmdb.c
index 9f6e7b47a71..481c39c54d9 100644
--- a/usr.bin/pmdb/pmdb.c
+++ b/usr.bin/pmdb/pmdb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmdb.c,v 1.5 2002/03/19 23:10:57 drahn Exp $ */
+/* $OpenBSD: pmdb.c,v 1.6 2002/03/19 23:17:58 fgsch Exp $ */
/*
* Copyright (c) 2002 Artur Grabowski <art@openbsd.org>
* All rights reserved.
@@ -74,12 +74,14 @@ struct clit cmds[] = {
{ "exit", "quit", 0, 0, cmd_quit, (void *)-1 },
};
+#define NCMDS sizeof(cmds)/sizeof(cmds[0])
+
int
main(int argc, char **argv)
{
extern const char *__progname;
struct pstate ps;
- int i, ncmds;
+ int i;
int status;
void *cm;
char *pmenv;
@@ -113,9 +115,7 @@ main(int argc, char **argv)
signal(SIGINT, SIG_IGN);
- ncmds = sizeof(cmds)/sizeof(cmds[0]);
-
- for (i = 0; i < ncmds; i++)
+ for (i = 0; i < NCMDS; i++)
if (cmds[i].arg == (void *)-1)
cmds[i].arg = &ps;
@@ -124,7 +124,7 @@ main(int argc, char **argv)
process_load(&ps);
- cm = cmdinit(cmds, ncmds);
+ cm = cmdinit(cmds, NCMDS);
while (ps.ps_state != TERMINATED) {
int signum;
int stopped;
@@ -263,7 +263,7 @@ cmd_show_backtrace(int argc, char **argv, void *arg)
printf(", ");
}
if (offs == 0) {
- printf(")\n", offs);
+ printf(")\n");
} else {
printf(")+0x%lx\n", offs);
}