mirror of
https://github.com/freebsd/freebsd-src
synced 2024-11-05 18:22:52 +00:00
Don't print out a gratuitous null entry for name list.
This commit is contained in:
parent
4adf9b35b4
commit
218b589a83
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=39953
1 changed files with 4 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue