svn path=/trunk/; revision=11199
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: profile.c,v 1.14 2004/10/03 09:27:22 ekohl Exp $
+/* $Id: profile.c,v 1.15 2004/10/05 13:39:42 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
DWORD dwMaxLength)
{
WCHAR szSystemRoot[MAX_PATH];
DWORD dwMaxLength)
{
WCHAR szSystemRoot[MAX_PATH];
- WCHAR szDrivePostfix[3];
LPWSTR lpszPostfix;
LPWSTR lpszPtr;
LPWSTR lpszPostfix;
LPWSTR lpszPtr;
/* Build profile name postfix */
if (!ExpandEnvironmentStringsW (L"%SystemRoot%",
/* Build profile name postfix */
if (!ExpandEnvironmentStringsW (L"%SystemRoot%",
- dwPostfixLength = wcslen (lpszPostfix);
- if (szSystemRoot[0] != L'C')
- {
- dwPostfixLength += 2;
- szDrivePostfix[0] = L'_';
- szDrivePostfix[1] = szSystemRoot[0];
- szDrivePostfix[2] = (WCHAR)0;
- }
-
- if (wcslen (lpName) + dwPostfixLength >= dwMaxLength)
+ if (wcslen(lpName) + wcslen(lpszPostfix) >= dwMaxLength)
{
DPRINT1("Error: buffer overflow\n");
return FALSE;
}
{
DPRINT1("Error: buffer overflow\n");
return FALSE;
}
- wcscat (lpName, lpszPostfix);
- if (szSystemRoot[0] != L'C')
- {
- wcscat (lpName, szDrivePostfix);
- }
+ wcscat(lpName, lpszPostfix);