mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 01:24:38 +00:00
sizeof(HelloString) does already contain the terminating NULL. Thanks to Hartmut.
svn path=/trunk/; revision=18215
This commit is contained in:
parent
d5169058c9
commit
8732a698df
1 changed files with 2 additions and 3 deletions
|
@ -369,14 +369,13 @@ HidD_Hello(OUT PCHAR Buffer,
|
||||||
IN ULONG BufferLength)
|
IN ULONG BufferLength)
|
||||||
{
|
{
|
||||||
const CHAR HelloString[] = "Hello\n";
|
const CHAR HelloString[] = "Hello\n";
|
||||||
ULONG StrSize = sizeof(HelloString) + sizeof(HelloString[0]);
|
|
||||||
|
|
||||||
if(BufferLength > 0)
|
if(BufferLength > 0)
|
||||||
{
|
{
|
||||||
memcpy(Buffer, HelloString, min(StrSize, BufferLength));
|
memcpy(Buffer, HelloString, min(sizeof(HelloString), BufferLength));
|
||||||
}
|
}
|
||||||
|
|
||||||
return StrSize;
|
return sizeof(HelloString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue