]> jfr.im git - irc/charybdis-ircd/charybdis.git/commitdiff
libratbox/src/crypt.c: misc cleanup for compiler warnings
authorAaron Jones <redacted>
Mon, 31 Jul 2017 01:31:38 +0000 (01:31 +0000)
committerAaron Jones <redacted>
Fri, 4 Aug 2017 12:32:56 +0000 (12:32 +0000)
crypt.c:49:4: warning: 'break' will never be executed
              [-Wunreachable-code-break]
    (... and 3 more of the same)

crypt.c:627:7: warning: variable 'f' may be uninitialized when used
               here [-Wconditional-uninitialized]

crypt.c:539:12: note: initialize the variable 'f' to silence this
                warning

libratbox/src/crypt.c

index f2b09efdc3953545844e99677a3ea0a7346d93fd..e9b265551c504673427832b7d36ded37170c7aaf 100644 (file)
@@ -46,16 +46,12 @@ rb_crypt(const char *key, const char *salt)
                {
                case '1':
                        return rb_md5_crypt(key, salt);
-                       break;
                case '5':
                        return rb_sha256_crypt(key, salt);
-                       break;
                case '6':
                        return rb_sha512_crypt(key, salt);
-                       break;
                default:
                        return NULL;
-                       break;
                };
        }
        else
@@ -536,7 +532,7 @@ rb_do_des(uint32_t l_in, uint32_t r_in, uint32_t *l_out, uint32_t *r_out, int co
         *      l_in, r_in, l_out, and r_out are in pseudo-"big-endian" format.
         */
        uint32_t l, r, *kl, *kr, *kl1, *kr1;
-       uint32_t f, r48l, r48r;
+       uint32_t f = 0, r48l, r48r;
        int round;
 
        if(count == 0)