diff options
author | Fabien Thomas <fabient@FreeBSD.org> | 2010-06-05 22:57:53 +0000 |
---|---|---|
committer | Fabien Thomas <fabient@FreeBSD.org> | 2010-06-05 22:57:53 +0000 |
commit | 5c15d3c87e17db03c8af5f2f41a9a9dc6113ab3f (patch) | |
tree | de75faa05fc877292b9775274ef012019b77ebe7 /usr.sbin/pmcstat | |
parent | 8e57327bbf75f0c298fcfb9139a3c2db7ba7f03a (diff) | |
download | src-5c15d3c87e17db03c8af5f2f41a9a9dc6113ab3f.tar.gz src-5c15d3c87e17db03c8af5f2f41a9a9dc6113ab3f.zip |
Fix warnings found by Coverity.
Found with: Coverity Prevent(tm)
MFC after: 1 month
Notes
Notes:
svn path=/head/; revision=208858
Diffstat (limited to 'usr.sbin/pmcstat')
-rw-r--r-- | usr.sbin/pmcstat/pmcpl_calltree.c | 8 | ||||
-rw-r--r-- | usr.sbin/pmcstat/pmcstat.c | 3 | ||||
-rw-r--r-- | usr.sbin/pmcstat/pmcstat_log.c | 1 |
3 files changed, 8 insertions, 4 deletions
diff --git a/usr.sbin/pmcstat/pmcpl_calltree.c b/usr.sbin/pmcstat/pmcpl_calltree.c index 09551334d558..b0f1c6e35bd7 100644 --- a/usr.sbin/pmcstat/pmcpl_calltree.c +++ b/usr.sbin/pmcstat/pmcpl_calltree.c @@ -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, "* *"); diff --git a/usr.sbin/pmcstat/pmcstat.c b/usr.sbin/pmcstat/pmcstat.c index 89ec8f06b569..9587529f6271 100644 --- a/usr.sbin/pmcstat/pmcstat.c +++ b/usr.sbin/pmcstat/pmcstat.c @@ -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(®, spec, REG_EXTENDED|REG_NOSUB)) != 0) { regerror(rv, ®, errbuf, sizeof(errbuf)); diff --git a/usr.sbin/pmcstat/pmcstat_log.c b/usr.sbin/pmcstat/pmcstat_log.c index 3458bd316992..a265cb986be2 100644 --- a/usr.sbin/pmcstat/pmcstat_log.c +++ b/usr.sbin/pmcstat/pmcstat_log.c @@ -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)) |