From 218b589a835694beedbf9a66153d8f2f5e9567df Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Sun, 4 Oct 1998 14:23:06 +0000 Subject: [PATCH] Don't print out a gratuitous null entry for name list. --- release/dumpnlist.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/release/dumpnlist.c b/release/dumpnlist.c index 565802e2b871..07b6947492e3 100644 --- a/release/dumpnlist.c +++ b/release/dumpnlist.c @@ -28,7 +28,7 @@ struct nlist nl[] = { int main(int ac, char **av) { - int i; + int i, len; i = nlist(av[1], nl); if (i == -1) { @@ -36,8 +36,9 @@ main(int ac, char **av) perror("nlist"); return 1; } - printf("%d\n", sizeof(nl) / sizeof(struct nlist)); - for (i = 0; nl[i].n_name && nl[i].n_name[0]; i++) { + len = (sizeof(nl) / sizeof(struct nlist)) - 1; + printf("%d\n", len); + for (i = 0; i < len; i++) { printf("%s\n", nl[i].n_name); printf("%d %d %d %ld\n", nl[i].n_type, nl[i].n_other, nl[i].n_desc, nl[i].n_value);