about summary refs log tree commit diff
path: root/sunrpc/xcrypt.c
diff options
context:
space:
mode:
Diffstat (limited to 'sunrpc/xcrypt.c')
-rw-r--r--sunrpc/xcrypt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sunrpc/xcrypt.c b/sunrpc/xcrypt.c
index d770a7d648..bee38ad8b5 100644
--- a/sunrpc/xcrypt.c
+++ b/sunrpc/xcrypt.c
@@ -143,7 +143,7 @@ passwd2des (char *pw, char *key)
   int i;
 
   memset (key, 0, 8);
-  for (i = 0; *pw; i = (i + 1) % 8)
+  for (i = 0; *pw && i < 8; ++i)
     key[i] ^= *pw++ << 1;
 
   des_setparity (key);