X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Ftincctl.c;h=4357d4a0e2209cdddadc28d13f0765d237ae65e1;hb=2bda2aa8855ff3ae42aba7aa86e1d7ff2b7a3b34;hp=6d7f03b877e0be11a69e81093c46b4bfa060616a;hpb=809dfd2f5b08ecbfe55d1a06d267abeef0044b0b;p=tinc diff --git a/src/tincctl.c b/src/tincctl.c index 6d7f03b8..4357d4a0 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -150,7 +150,6 @@ FILE *ask_and_open(const char *filename, const char *what, const char *mode) { char *directory; char buf[PATH_MAX]; char buf2[PATH_MAX]; - size_t len; /* Check stdin and stdout */ if(isatty(0) && isatty(1)) { @@ -165,7 +164,7 @@ FILE *ask_and_open(const char *filename, const char *what, const char *mode) { return NULL; } - len = strlen(buf); + size_t len = strlen(buf); if(len) buf[--len] = 0; @@ -488,7 +487,7 @@ int main(int argc, char *argv[], char *envp[]) { fprintf(stderr, "Could not open control socket cookie file %s: %s\n", controlcookiename, strerror(errno)); return 1; } - if(fscanf(f, "%1024s %128s %d", controlcookie, port, &pid) != 3) { + if(fscanf(f, "%1024s %128s %20d", controlcookie, port, &pid) != 3) { fprintf(stderr, "Could not parse control socket cookie file %s\n", controlcookiename); return 1; }