libratbox/src/crypt.c: misc cleanup for compiler warnings

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
This commit is contained in:
Aaron Jones 2017-07-31 01:31:38 +00:00
parent 9519919ff5
commit 3f7ccca917
No known key found for this signature in database
GPG key ID: 8AF0737488AB3012

View 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)