diff options
author | RALOVICH, Kristof <tade60@freemail.hu> | 2014-08-11 18:58:29 +0200 |
---|---|---|
committer | RALOVICH, Kristof <tade60@freemail.hu> | 2014-08-11 18:58:29 +0200 |
commit | bae40e4c66c22c043e471c1d238af22b6f720e0d (patch) | |
tree | e210023555287f51507fd3f4d6de0e8edc80d2ca | |
parent | f93dd6c407d4f74b6454448cd86942b11d61cbcc (diff) |
fix more static analysis problems
from coverity
-rw-r--r-- | src/SerialTty.cpp | 1 | ||||
-rw-r--r-- | src/gant/antlib.c | 2 | ||||
-rw-r--r-- | src/gant/gant.c | 5 |
3 files changed, 5 insertions, 3 deletions
diff --git a/src/SerialTty.cpp b/src/SerialTty.cpp index 6612909..51b7771 100644 --- a/src/SerialTty.cpp +++ b/src/SerialTty.cpp @@ -69,6 +69,7 @@ struct SerialTtyPrivate // runs in other thread struct SerialTtyIOThread { + SerialTtyIOThread() : rv(NULL) {} void operator() (SerialTty* arg) { //printf("recvFunc, arg: %p\n", arg); fflush(stdout); diff --git a/src/gant/antlib.c b/src/gant/antlib.c index e879b8d..2b8c202 100644 --- a/src/gant/antlib.c +++ b/src/gant/antlib.c @@ -119,7 +119,7 @@ void get_data(int fd) uchar event; int found; int srch; - int next; + int next = 0; nr = read(fd, buf+bufc, 20); if (nr > 0) diff --git a/src/gant/gant.c b/src/gant/gant.c index 73b04cb..b146665 100644 --- a/src/gant/gant.c +++ b/src/gant/gant.c @@ -1327,9 +1327,10 @@ int main(int ac, char *av[]) /* default auth file // */ if (getenv("HOME")) { - authfile = malloc(strlen(getenv("HOME")) + strlen("/.gant") + 1); + const char* h = getenv("HOME"); + authfile = malloc(strlen(h) + strlen("/.gant") + 1); if (authfile) - sprintf(authfile, "%s/.gant", getenv("HOME")); + sprintf(authfile, "%s/.gant", h); } progname = av[0]; while ((c = getopt(ac, av, "a:f:d:i:m:pvD:rnzh")) != -1) |