Fixed compiler warnings

This commit is contained in:
2019-05-21 12:24:34 +02:00
parent b8a3c9449e
commit 13bd96e50e
2 changed files with 11 additions and 3 deletions
+10 -2
View File
@@ -513,18 +513,24 @@ int auth_verify_password_file(LOGBOOK * lbs, const char *user, const char *passw
{
char upwd[256], enc_pwd[256];
if (error_size)
*error_str = 0;
get_user_line(lbs, (char *) user, upwd, NULL, NULL, NULL, NULL, NULL);
do_crypt(password, enc_pwd, sizeof(enc_pwd));
return strcmp(enc_pwd, upwd) == 0;
}
int auth_change_password_file(LOGBOOK * lbs, const char *user, const char *old_pwd, const char *new_pwd,
int auth_change_password_file(LOGBOOK * lbs, const char *user, const char *new_pwd,
char *error_str, int error_size)
{
char str[256], file_name[256], enc_pwd[256];
PMXML_NODE node;
if (error_size)
*error_str = 0;
if (lbs == NULL)
lbs = get_first_lbs_with_global_passwd();
@@ -613,7 +619,9 @@ int auth_change_password(LOGBOOK * lbs, const char *user, const char *old_pwd, c
getcfg(lbs->name, "Authentication", str, sizeof(str));
if (str[0] == 0 || stristr(str, "File"))
status = auth_change_password_file(lbs, user, old_pwd, new_pwd, error_str, error_size);
status = auth_change_password_file(lbs, user, new_pwd, error_str, error_size);
if (old_pwd) {} // avoid compiler warning
#ifdef HAVE_KRB5
if (stristr(str, "Kerberos"))
+1 -1
View File
@@ -113,7 +113,7 @@ static void sha256_process_block(const void *buffer, size_t len, struct sha256_c
length of the file up to 2^64 bits. Here we only compute the
number of bytes. Do a double word increment. */
ctx->total[0] += len;
if (ctx->total[0] < (int) len)
if (ctx->total[0] < len)
++ctx->total[1];
/* Process all bytes in the buffer with 64 bytes in each round of