_SendString() is used to both send data, typically the content of files, and perl strings. In the first case $Type is 'd', and in the latter 's' and a trailing '\0' is added to match the C convention.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- testbot/lib/WineTestBot/TestAgent.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/testbot/lib/WineTestBot/TestAgent.pm b/testbot/lib/WineTestBot/TestAgent.pm index 8957b9f829..a128e347e4 100644 --- a/testbot/lib/WineTestBot/TestAgent.pm +++ b/testbot/lib/WineTestBot/TestAgent.pm @@ -791,10 +791,12 @@ sub _SendUInt64($$$) sub _SendString($$$;$) { my ($self, $Name, $Str, $Type) = @_; + $Type ||= 's'; + debug(" SendString('$Name', '$Str', '$Type')\n");
- debug(" SendString('$Name', '$Str')\n"); - $Str .= "\0"; - return $self->_SendEntryHeader($Name, $Type || 's', length($Str)) && + # Add a trailing '\0' to strings to match the C convention. + $Str .= "\0" if ($Type eq 's'); + return $self->_SendEntryHeader($Name, $Type, length($Str)) && $self->_SendRawData($Name, $Str); }