From: Ralph Corderoy Date: Fri, 21 Oct 2016 08:53:45 +0000 (+0100) Subject: Fix warnings caused by recent edits; don't mix declarations and code. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/d20cac6971c9e649cc88e6533e7fa1367e488e14?ds=inline;hp=f1595ee7fc4db1bf8c50b00a796fb3f9b1d66c21 Fix warnings caused by recent edits; don't mix declarations and code. Quite right too, I prefer all the declarations, codeless, up front. The standard -Wall didn't pick this up. David pointed it out, probably due to his defaults of `-pedantic -ansi'. --- diff --git a/sbr/lock_file.c b/sbr/lock_file.c index 4057c4cf..9fbcbd78 100644 --- a/sbr/lock_file.c +++ b/sbr/lock_file.c @@ -495,6 +495,8 @@ lkopen_dot (const char *file, int access, mode_t mode, int *failed_to_lock) { int i; for (i = 0; i < LOCK_RETRIES; ++i) { + struct stat st; + /* attempt to create lock file */ if (lockit (&lkinfo) == 0) { /* if successful, turn on timer and return */ @@ -508,7 +510,6 @@ lkopen_dot (const char *file, int access, mode_t mode, int *failed_to_lock) * we can stat the lockfile but exceed LOCK_RETRIES * seconds waiting for it (by falling out of the loop). */ - struct stat st; if (stat (lkinfo.curlock, &st) == -1) { if (i++ > 5) break; sleep (1); diff --git a/uip/popsbr.c b/uip/popsbr.c index fa9b99d1..54fd24ff 100644 --- a/uip/popsbr.c +++ b/uip/popsbr.c @@ -240,6 +240,8 @@ pop_init (char *host, char *port, char *user, char *proxy, int snoop, if (poprint) fprintf (stderr, "<--- %s\n", response); if (*response == '+') { + nmh_creds_t creds; + if (sasl) { char server_mechs[256]; if (check_mech(server_mechs, sizeof(server_mechs)) != OK) @@ -253,7 +255,6 @@ pop_init (char *host, char *port, char *user, char *proxy, int snoop, } return OK; } - nmh_creds_t creds; if (!(creds = nmh_get_credentials(host, user))) return NOTOK;