diff options
Diffstat (limited to 'crypt/sha512-crypt.c')
-rw-r--r-- | crypt/sha512-crypt.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crypt/sha512-crypt.c b/crypt/sha512-crypt.c index 9deb31ce99..b592eb0976 100644 --- a/crypt/sha512-crypt.c +++ b/crypt/sha512-crypt.c @@ -142,7 +142,7 @@ __sha512_crypt_r (const char *key, const char *salt, char *buffer, int buflen) salt_len = MIN (strcspn (salt, "$"), SALT_LEN_MAX); key_len = strlen (key); - if ((key - (char *) 0) % __alignof__ (uint64_t) != 0) + if (((uintptr_t) key) % __alignof__ (uint64_t) != 0) { char *tmp; @@ -157,19 +157,19 @@ __sha512_crypt_r (const char *key, const char *salt, char *buffer, int buflen) key = copied_key = memcpy (tmp + __alignof__ (uint64_t) - - (tmp - (char *) 0) % __alignof__ (uint64_t), + - ((uintptr_t) tmp) % __alignof__ (uint64_t), key, key_len); - assert ((key - (char *) 0) % __alignof__ (uint64_t) == 0); + assert (((uintptr_t) key) % __alignof__ (uint64_t) == 0); } - if ((salt - (char *) 0) % __alignof__ (uint64_t) != 0) + if (((uintptr_t) salt) % __alignof__ (uint64_t) != 0) { char *tmp = (char *) alloca (salt_len + __alignof__ (uint64_t)); salt = copied_salt = memcpy (tmp + __alignof__ (uint64_t) - - (tmp - (char *) 0) % __alignof__ (uint64_t), + - ((uintptr_t) tmp) % __alignof__ (uint64_t), salt, salt_len); - assert ((salt - (char *) 0) % __alignof__ (uint64_t) == 0); + assert (((uintptr_t) salt) % __alignof__ (uint64_t) == 0); } #ifdef USE_NSS |