From b26e295137ad669de60101c8275b75313d6be73e Mon Sep 17 00:00:00 2001 From: Tim Cava Date: Mon, 17 Jun 2013 08:00:37 +0000 Subject: [PATCH] Improve cryptit() fixes, suggested by caf. git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@241 13b04d17-f746-0410-82c6-800466cd88b0 --- source/ircaux.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/ircaux.c b/source/ircaux.c index 17f2230..16c4abf 100644 --- a/source/ircaux.c +++ b/source/ircaux.c @@ -2823,11 +2823,11 @@ char *crypt(); char *BX_cryptit(const char *string) { static char saltChars[] = - "abcdefghijklmnopqrstuvwxyzABCDEFGHJIKLMNOPQRSTUVWXYZ./"; + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ./0123456789"; char *cpass = (char *)string; char salt[3]; - salt[0] = saltChars[random_number(0) % sizeof(saltChars)]; - salt[1] = saltChars[random_number(0) % sizeof(saltChars)]; + salt[0] = saltChars[random_number(0) % (sizeof(saltChars) - 1)]; + salt[1] = saltChars[random_number(0) % (sizeof(saltChars) - 1)]; salt[2] = 0; #if !defined(WINNT) cpass = crypt(string, salt);