aboutsummaryrefslogtreecommitdiff
path: root/lib/password.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2013-11-03 17:09:33 -0600
committerRob Landley <rob@landley.net>2013-11-03 17:09:33 -0600
commit938b830abadd2a9dd4260bea3636e188f925959e (patch)
treef7bd7bd38b0816fc440e246a28e295919c508a64 /lib/password.c
parent599a13b177962615fa4a2de9c30f169659831307 (diff)
downloadtoybox-938b830abadd2a9dd4260bea3636e188f925959e.tar.gz
Fix off by one, pointed out by Ashwini Sharma.
Diffstat (limited to 'lib/password.c')
-rw-r--r--lib/password.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/password.c b/lib/password.c
index 6e8f0554..34abf6e7 100644
--- a/lib/password.c
+++ b/lib/password.c
@@ -41,8 +41,8 @@ int get_salt(char *salt, char *algo)
bits = ((buf[i]+(buf[i+1]<<8)) >> (bitpos&7)) & 0x3f;
bits += 46;
- if (bits > 57) bits += 8;
- if (bits > 90) bits += 7;
+ if (bits > 57) bits += 7;
+ if (bits > 90) bits += 6;
salt[i] = bits;
}