Avoid compiler casting warnings Part 2

This saves instructions that are related to casting as well as compiler warnings.
This commit is contained in:
Rose
2023-05-18 14:38:18 -04:00
parent f2a274b061
commit 22079c3072
21 changed files with 44 additions and 45 deletions

View File

@@ -84,9 +84,9 @@ digest_matches(int fd, const char *path,
}
if (strlen(digest->digest_str) == digest_len * 2) {
/* Convert ascii hex to binary. */
unsigned int i;
size_t i;
for (i = 0; i < digest_len; i++) {
const int h = sudo_hexchar(&digest->digest_str[i + i]);
const int h = sudo_hexchar(&digest->digest_str[2 * i]);
if (h == -1)
goto bad_format;
sudoers_digest[i] = (unsigned char)h;