Tidying: Issues detected by gcc --fsanitize=undefined
[exim.git] / src / src / auths / sha1.c
index f6d7ef4efc46862882fb2e2bca4650219dd430d7..a92bb71d150a102b414b237cf3a5552dfe4c6d62 100644 (file)
@@ -1,10 +1,8 @@
-/* $Cambridge: exim/src/src/auths/sha1.c,v 1.2 2005/01/04 10:00:43 ph10 Exp $ */
-
 /*************************************************
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) University of Cambridge 1995 - 2005 */
+/* Copyright (c) University of Cambridge 1995 - 2009 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 #ifndef STAND_ALONE
@@ -64,15 +62,15 @@ Returns:     nothing
 void
 sha1_mid(sha1 *base, const uschar *text)
 {
-register int i;
-unsigned int A, B, C, D, E;
-unsigned int W[80];
+int i;
+uint A, B, C, D, E;
+uint W[80];
 
 base->length += 64;
 
 for (i = 0; i < 16; i++)
   {
-  W[i] = (text[0] << 24) | (text[1] << 16) | (text[2] << 8) | text[3];
+  W[i] = ((uint)text[0] << 24) | (text[1] << 16) | (text[2] << 8) | text[3];
   text += 4;
   }