From 9b2a9f0210f13f1c59c0b954c4aa0eeb0a66efd1 Mon Sep 17 00:00:00 2001
From: Denys Vlasenko <vda.linux@googlemail.com>
Date: Fri, 29 Nov 2013 16:43:33 +0100
Subject: fix assorted unused code and wrong format specs found by cppchekc
 (bug 6716)

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
---
 libbb/pw_encrypt_md5.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'libbb')

diff --git a/libbb/pw_encrypt_md5.c b/libbb/pw_encrypt_md5.c
index 889e09cab..1e52ecaea 100644
--- a/libbb/pw_encrypt_md5.c
+++ b/libbb/pw_encrypt_md5.c
@@ -86,7 +86,7 @@ md5_crypt(char result[MD5_OUT_BUFSIZE], const unsigned char *pw, const unsigned
 
 	/* Get the length of the salt including "$1$" */
 	sl = 3;
-	while (salt[sl] && salt[sl] != '$' && sl < (3 + 8))
+	while (sl < (3 + 8) && salt[sl] && salt[sl] != '$')
 		sl++;
 
 	/* Hash. the password first, since that is what is most unknown */
-- 
cgit v1.2.3-55-g6feb