smartcard: fix calc of remaining data size when reading more than one msg from the device

This commit is contained in:
Yonit Halperin 2012-06-24 20:33:19 +03:00
parent 3a4d54273b
commit b468f14e23

View File

@ -107,7 +107,7 @@ void smartcard_char_device_wakeup(SpiceCharDeviceInstance *sin)
continue;
}
smartcard_char_device_on_message_from_device(state, vheader);
remaining = state->buf_used - sizeof(VSCMsgHeader) > actual_length;
remaining = state->buf_used - sizeof(VSCMsgHeader) - actual_length;
if (remaining > 0) {
memcpy(state->buf, state->buf_pos, remaining);
}