Don't write 0-length data
This commit is contained in:
@@ -139,6 +139,7 @@ send_packet(int fd, COMMAND_PACKET *out)
|
|||||||
{
|
{
|
||||||
write(fd, &out->command, 1);
|
write(fd, &out->command, 1);
|
||||||
write(fd, &out->data_length, 1);
|
write(fd, &out->data_length, 1);
|
||||||
|
if (out->data_length > 0)
|
||||||
write(fd, out->data, out->data_length);
|
write(fd, out->data, out->data_length);
|
||||||
|
|
||||||
/* calculate & send the CRC */
|
/* calculate & send the CRC */
|
||||||
|
|||||||
Reference in New Issue
Block a user