aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-07-24 21:03:16 +0000
committerUlrich Drepper <drepper@redhat.com>2000-07-24 21:03:16 +0000
commit5bef282098d6c920c12e46dea5bac099e5cb3abf (patch)
treea8eadab44e26951b9bf0abdcfc964afbe06cdbc1 /crypt/md5-crypt.c
parentUpdate. (diff)
downloadglibc-5bef282098d6c920c12e46dea5bac099e5cb3abf.tar.gz
glibc-5bef282098d6c920c12e46dea5bac099e5cb3abf.tar.bz2
glibc-5bef282098d6c920c12e46dea5bac099e5cb3abf.zip
Update.
2000-07-24 Jakub Jelinek <jakub@redhat.com> * libio/wfiledoalloc.c (_IO_wfile_doallocate): Measure size in wide characters, not bytes. * libio/tst_putwc.c (do_test): Add test for writing lots of data into file. 2000-07-22 Bruno Haible <haible@clisp.cons.org> * locale/nl_langinfo.c (nl_langinfo): Accept items belonging to the new categories LC_PAPER, LC_NAME, LC_ADDRESS, LC_TELEPHONE, LC_MEASUREMENT, LC_IDENTIFICATION. * locale/xlocale.h (struct __locale_struct): Increase size of __locales array. * locale/duplocale.c (__duplocale): Copy newly added categories as well. * locale/freelocale.c (__freelocale): Free newly added categories. * locale/newlocale.c (__newlocale): Fix typo in sanity check. If a base is given, use it, don't simply return it. 2000-07-22 Bruno Haible <haible@clisp.cons.org> * crypt/md5-crypt.c (__md5_crypt_r): Avoid gcc warnings: Use pointer variables, copied_key and copied_salt, instead of boolean variables.
Diffstat (limited to 'crypt/md5-crypt.c')
-rw-r--r--crypt/md5-crypt.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/crypt/md5-crypt.c b/crypt/md5-crypt.c
index c842be503c..e99f8ca199 100644
--- a/crypt/md5-crypt.c
+++ b/crypt/md5-crypt.c
@@ -60,8 +60,8 @@ __md5_crypt_r (key, salt, buffer, buflen)
size_t key_len;
size_t cnt;
char *cp;
- int key_copied = 0;
- int salt_copied = 0;
+ char *copied_key = NULL;
+ char *copied_salt = NULL;
/* Find beginning of salt string. The prefix should normally always
be present. Just in case it is not. */
@@ -75,21 +75,21 @@ __md5_crypt_r (key, salt, buffer, buflen)
if ((key - (char *) 0) % __alignof__ (md5_uint32) != 0)
{
char *tmp = (char *) alloca (key_len + __alignof__ (md5_uint32));
- key = memcpy (tmp + __alignof__ (md5_uint32)
- - (tmp - (char *) 0) % __alignof__ (md5_uint32),
- key, key_len);
+ key = copied_key =
+ memcpy (tmp + __alignof__ (md5_uint32)
+ - (tmp - (char *) 0) % __alignof__ (md5_uint32),
+ key, key_len);
assert ((key - (char *) 0) % __alignof__ (md5_uint32) == 0);
- key_copied = 1;
}
if ((salt - (char *) 0) % __alignof__ (md5_uint32) != 0)
{
char *tmp = (char *) alloca (salt_len + __alignof__ (md5_uint32));
- salt = memcpy (tmp + __alignof__ (md5_uint32)
- - (tmp - (char *) 0) % __alignof__ (md5_uint32),
- salt, salt_len);
+ salt = copied_salt =
+ memcpy (tmp + __alignof__ (md5_uint32)
+ - (tmp - (char *) 0) % __alignof__ (md5_uint32),
+ salt, salt_len);
assert ((salt - (char *) 0) % __alignof__ (md5_uint32) == 0);
- salt_copied = 1;
}
/* Prepare for the real work. */
@@ -225,10 +225,10 @@ __md5_crypt_r (key, salt, buffer, buflen)
__md5_finish_ctx (&ctx, alt_result);
memset (&ctx, '\0', sizeof (ctx));
memset (&alt_ctx, '\0', sizeof (alt_ctx));
- if (key_copied)
- memset ((char *) key, '\0', key_len);
- if (salt_copied)
- memset ((char *) salt, '\0', salt_len);
+ if (copied_key != NULL)
+ memset (copied_key, '\0', key_len);
+ if (copied_salt != NULL)
+ memset (copied_salt, '\0', salt_len);
return buffer;
}