From 1e0a179dd402e61942f2a38a12ddf25d085c3353 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9=20van=20Geldorp?= Date: Sat, 26 Apr 2003 08:56:50 +0000 Subject: [PATCH] FileNameLength and ShortNameLength are in bytes, adjust offset for writing terminating NUL character accordingly svn path=/trunk/; revision=4587 --- reactos/lib/kernel32/file/find.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/reactos/lib/kernel32/file/find.c b/reactos/lib/kernel32/file/find.c index 04f7f74759a..467bc4b3b83 100644 --- a/reactos/lib/kernel32/file/find.c +++ b/reactos/lib/kernel32/file/find.c @@ -1,4 +1,4 @@ -/* $Id: find.c,v 1.35 2003/03/23 10:48:14 hbirr Exp $ +/* $Id: find.c,v 1.36 2003/04/26 08:56:50 gvg Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -470,11 +470,11 @@ FindFirstFileW ( memcpy (lpFindFileData->cFileName, IData->pFileInfo->FileName, IData->pFileInfo->FileNameLength); - lpFindFileData->cFileName[IData->pFileInfo->FileNameLength] = 0; + lpFindFileData->cFileName[IData->pFileInfo->FileNameLength / sizeof(WCHAR)] = 0; memcpy (lpFindFileData->cAlternateFileName, IData->pFileInfo->ShortName, IData->pFileInfo->ShortNameLength); - lpFindFileData->cAlternateFileName[IData->pFileInfo->ShortNameLength] = 0; + lpFindFileData->cAlternateFileName[IData->pFileInfo->ShortNameLength / sizeof(WCHAR)] = 0; return IData; } @@ -511,11 +511,11 @@ FindNextFileW ( memcpy (lpFindFileData->cFileName, IData->pFileInfo->FileName, IData->pFileInfo->FileNameLength); - lpFindFileData->cFileName[IData->pFileInfo->FileNameLength] = 0; + lpFindFileData->cFileName[IData->pFileInfo->FileNameLength / sizeof(WCHAR)] = 0; memcpy (lpFindFileData->cAlternateFileName, IData->pFileInfo->ShortName, IData->pFileInfo->ShortNameLength); - lpFindFileData->cAlternateFileName[IData->pFileInfo->ShortNameLength] = 0; + lpFindFileData->cAlternateFileName[IData->pFileInfo->ShortNameLength / sizeof(WCHAR)] = 0; return TRUE; }