Skip to content

Commit 0e3b403

Browse files
committed
fixed:lib module password not work
1 parent 2aa5a18 commit 0e3b403

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/Plugin_Password/Plugin_Password.cpp

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,26 +108,17 @@ bool CPlugin_Password::Plugin_Password_Creator(LPCXSTR lpszPassType, LPCXSTR lps
108108

109109
int nType = _ttxoi(lpszPassType);
110110
int nLen = _ttxoi(lpszLength);
111-
XCHAR tszPassBuffer[MAX_PATH];
112-
113-
memset(tszPassBuffer, '\0', MAX_PATH);
114111
if (0 == nType)
115112
{
116-
BaseLib_Handle_CreateStr(tszPassBuffer, nLen);
113+
BaseLib_Handle_CreateStr(ptszPassStr, nLen);
117114
}
118115
else if (1 == nType)
119116
{
120-
for (int i = 0; i < nLen; i++)
121-
{
122-
_xstprintf(&tszPassBuffer[i], _X("%d"), rand() % 9);
123-
}
117+
BaseLib_Handle_CreateStr(ptszPassStr, nLen, 1);
124118
}
125119
else if (2 == nType)
126120
{
127-
for (int i = 0; i < nLen; i++)
128-
{
129-
_xstprintf(&tszPassBuffer[i], _X("%c"), (rand() % 26) + 65);
130-
}
121+
BaseLib_Handle_CreateStr(ptszPassStr, nLen, 2);
131122
}
132123
return true;
133124
}

0 commit comments

Comments
 (0)