sizeof(HelloString) does already contain the terminating NULL. Thanks to
Hartmut.
Modified: trunk/reactos/lib/hid/hid.c
_____
Modified: trunk/reactos/lib/hid/hid.c
--- trunk/reactos/lib/hid/hid.c 2005-10-02 13:47:48 UTC (rev 18214)
+++ trunk/reactos/lib/hid/hid.c 2005-10-02 13:54:32 UTC (rev 18215)
@@ -369,14 +369,13 @@
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);
}