Use the z as print format for size_t variable instead of l to make it platform independent
`l` is a format for `long int`. It accidentally worked on 64 bit architectures, because `long int` has the same length as `size_t` there. It didn't work on 32 bit architectures, where `size_t` is shorter than `long int`. Let's use `z`, because that's the proper format for `size_t` -- it works on any platform.
This commit is contained in:
parent
03f69c8685
commit
5cc79d9782
1 changed files with 1 additions and 1 deletions
|
|
@ -70,7 +70,7 @@ void QemudMessageProcessor::process_commands() {
|
|||
|
||||
void QemudMessageProcessor::send_header(const size_t &size) {
|
||||
char header[header_size + 1];
|
||||
std::snprintf(header, header_size + 1, "%04lx", size);
|
||||
std::snprintf(header, header_size + 1, "%04zx", size);
|
||||
messenger_->send(header, header_size);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue