]> diplodocus.org Git - nmh/commitdiff
Fix warnings caused by recent edits; don't mix declarations and code.
authorRalph Corderoy <ralph@inputplus.co.uk>
Fri, 21 Oct 2016 08:53:45 +0000 (09:53 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Fri, 21 Oct 2016 08:58:40 +0000 (09:58 +0100)
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'.

sbr/lock_file.c
uip/popsbr.c

index 4057c4cfca6a2bde182ff2850b8dcc7544c24a61..9fbcbd78d94dec5320177858f89a58066394dd7e 100644 (file)
@@ -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);
index fa9b99d1e542dcddc208350b7d184feb4d538758..54fd24ffe3515a9d9f885cdbb89a11fb6303e933 100644 (file)
@@ -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;