X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Ftincctl.c;h=8181dd93211e2a28beb8dc103c3d770665be3a23;hb=1ebadf1a4e497f36d6d3a916b14b4f29c925fda5;hp=93c5b320b6e963b2719c102a4f921e6c3fb00b1d;hpb=1c475ecb575367a6b3f9328b0f643ad636155341;p=tinc diff --git a/src/tincctl.c b/src/tincctl.c index 93c5b320..8181dd93 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -2301,6 +2301,7 @@ static int cmd_init(int argc, char *argv[]) { static int cmd_generate_keys(int argc, char *argv[]) { #ifdef DISABLE_LEGACY + (void)argv; if(argc > 1) { #else @@ -2440,10 +2441,14 @@ static int cmd_edit(int argc, char *argv[]) { char *command; #ifndef HAVE_MINGW const char *editor = getenv("VISUAL"); - if (!editor) + + if(!editor) { editor = getenv("EDITOR"); - if (!editor) + } + + if(!editor) { editor = "vi"; + } xasprintf(&command, "\"%s\" \"%s\"", editor, filename); #else @@ -2735,11 +2740,11 @@ static int cmd_fsck(int argc, char *argv[]) { static void *readfile(FILE *in, size_t *len) { size_t count = 0; - size_t alloced = 4096; - char *buf = xmalloc(alloced); + size_t bufsize = 4096; + char *buf = xmalloc(bufsize); while(!feof(in)) { - size_t read = fread(buf + count, 1, alloced - count, in); + size_t read = fread(buf + count, 1, bufsize - count, in); if(!read) { break; @@ -2747,9 +2752,9 @@ static void *readfile(FILE *in, size_t *len) { count += read; - if(count >= alloced) { - alloced *= 2; - buf = xrealloc(buf, alloced); + if(count >= bufsize) { + bufsize *= 2; + buf = xrealloc(buf, bufsize); } }