mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-02-05 21:21:38 +00:00
cpukit/libcrypt: Address -Wsign-compare warnings
This warning occurs when comparing a signed variable to an unsigned one. This is frequently an int or ssize_t variable compared to a uint32_t or size_t. Sometimes the size_t is from a sizeof() use.
This commit is contained in:
committed by
Gedare Bloom
parent
5be6a2ea4f
commit
939d18ba4e
@@ -165,7 +165,11 @@ crypt_sha256_r(const char *key, const char *salt, struct crypt_data *data)
|
||||
SHA256_Init(&alt_ctx);
|
||||
|
||||
/* For every character in the password add the entire password. */
|
||||
#ifdef __rtems__
|
||||
for (cnt = 0; cnt < (size_t) (16 + alt_result[0]); ++cnt)
|
||||
#else
|
||||
for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt)
|
||||
#endif
|
||||
SHA256_Update(&alt_ctx, salt, salt_len);
|
||||
|
||||
/* Finish the digest. */
|
||||
|
||||
@@ -165,7 +165,11 @@ crypt_sha512_r(const char *key, const char *salt, struct crypt_data *data)
|
||||
SHA512_Init(&alt_ctx);
|
||||
|
||||
/* For every character in the password add the entire password. */
|
||||
#ifdef __rtems__
|
||||
for (cnt = 0; cnt < (size_t) (16 + alt_result[0]); ++cnt)
|
||||
#else
|
||||
for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt)
|
||||
#endif
|
||||
SHA512_Update(&alt_ctx, salt, salt_len);
|
||||
|
||||
/* Finish the digest. */
|
||||
|
||||
Reference in New Issue
Block a user