From 608aa1d9db9153d98f07e6153697d0aeddaede6d Mon Sep 17 00:00:00 2001 From: Philippe Saint-Pierre Date: Sat, 12 Sep 2009 01:16:15 +0000 Subject: [PATCH] ScreenSaver : Clean up the sanitize routine to use the isalnum(..) function. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33070 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/preferences/screensaver/PasswordWindow.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/preferences/screensaver/PasswordWindow.cpp b/src/preferences/screensaver/PasswordWindow.cpp index a958848fbb..7b06a8c675 100644 --- a/src/preferences/screensaver/PasswordWindow.cpp +++ b/src/preferences/screensaver/PasswordWindow.cpp @@ -18,6 +18,8 @@ #include #include +#include + const uint32 kMsgDone = 'done'; const uint32 kMsgPasswordTypeChanged = 'pwtp'; @@ -139,10 +141,7 @@ PasswordWindow::_SanitizeSalt(const char *password) uint8 i = 0; uint8 j = 0; for (; i < length; i++) { - if ((password[i] >= 'A' && password[i] <= 'Z') - || (password[i] >= 'a' && password[i] <= 'z') - || (password[i] >= '0' && password[i] <= '9') - || (password[i] == '.' || password[i] == '/')) { + if (isalnum(password[i]) || password[i] == '.' || password[i] == '/') { salt[j] = password[i]; j++; }