diff options
author | fabient <fabient@FreeBSD.org> | 2010-06-05 22:57:53 +0000 |
---|---|---|
committer | fabient <fabient@FreeBSD.org> | 2010-06-05 22:57:53 +0000 |
commit | 0ecf60c0b77f328d007521e54b05d0c3c183a117 (patch) | |
tree | de75faa05fc877292b9775274ef012019b77ebe7 | |
parent | 28122090a3c8d73d47366b9bce6059f02763a23b (diff) | |
download | FreeBSD-src-0ecf60c0b77f328d007521e54b05d0c3c183a117.zip FreeBSD-src-0ecf60c0b77f328d007521e54b05d0c3c183a117.tar.gz |
Fix warnings found by Coverity.
Found with: Coverity Prevent(tm)
MFC after: 1 month
-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 0955133..b0f1c6e 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 89ec8f0..9587529 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 3458bd3..a265cb9 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)) |