1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-29 08:08:37 +00:00

Fix warnings found by Coverity.

Found with:   Coverity Prevent(tm)
MFC after:	1 month
This commit is contained in:
Fabien Thomas 2010-06-05 22:57:53 +00:00
parent 8e57327bbf
commit 5c15d3c87e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=208858
3 changed files with 8 additions and 4 deletions

View File

@ -896,10 +896,12 @@ pmcpl_ct_node_printchild(struct pmcpl_ct_node *ct)
/* Call address, line, sample. */
addr = ct->pct_image->pi_vaddr + ct->pct_func;
line = 0;
pmcstat_image_addr2line(ct->pct_image, addr, sourcefile,
if (pmcstat_image_addr2line(ct->pct_image, addr, sourcefile,
sizeof(sourcefile), &line,
funcname, sizeof(funcname));
fprintf(args.pa_graphfile, "%p %u", (void *)addr, line);
funcname, sizeof(funcname)))
fprintf(args.pa_graphfile, "%p %u", (void *)addr, line);
else
fprintf(args.pa_graphfile, "* *");
}
else
fprintf(args.pa_graphfile, "* *");

View File

@ -292,7 +292,8 @@ pmcstat_find_targets(const char *spec)
0, &nproc)) == NULL)
err(EX_OSERR, "ERROR: Cannot get process list: %s",
kvm_geterr(pmcstat_kvm));
}
} else
nproc = 0;
if ((rv = regcomp(&reg, spec, REG_EXTENDED|REG_NOSUB)) != 0) {
regerror(rv, &reg, errbuf, sizeof(errbuf));

View File

@ -1957,6 +1957,7 @@ pmcstat_keypress_log(void)
case 'q':
wprintw(w, "exiting...");
ret = 1;
break;
default:
if (plugins[args.pa_plugin].pl_topkeypress != NULL)
if (plugins[args.pa_plugin].pl_topkeypress(c, w))