sizeof(HelloString) does already contain the terminating NULL. Thanks to Hartmut.

svn path=/trunk/; revision=18215
This commit is contained in:
Thomas Bluemel 2005-10-02 13:54:32 +00:00
parent d5169058c9
commit 8732a698df

View file

@ -369,14 +369,13 @@ HidD_Hello(OUT PCHAR Buffer,
IN ULONG BufferLength)
{
const CHAR HelloString[] = "Hello\n";
ULONG StrSize = sizeof(HelloString) + sizeof(HelloString[0]);
if(BufferLength > 0)
{
memcpy(Buffer, HelloString, min(StrSize, BufferLength));
memcpy(Buffer, HelloString, min(sizeof(HelloString), BufferLength));
}
return StrSize;
return sizeof(HelloString);
}