Don't index-outta-bounds if someone leaves the username blank and tries

to log in.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1370 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
ray
2004-01-15 01:33:30 +00:00
parent 7cf9960ecf
commit dad7bc9b1a
@@ -1,5 +1,5 @@
//
// $Id: UserUtil.java,v 1.9 2003/07/20 01:43:59 mdb Exp $
// $Id: UserUtil.java,v 1.10 2004/01/15 01:33:30 ray Exp $
//
// samskivert library - useful routines for java programs
// Copyright (C) 2001 Michael Bayne
@@ -71,7 +71,7 @@ public class UserUtil
if (ignoreUserCase) {
username = username.toLowerCase();
}
return Crypt.crypt(username.substring(0, 2), password);
return Crypt.crypt(StringUtil.truncate(username, 2), password);
}
public static void main (String[] args)