Initialize variables in native-wrapper.

This commit is contained in:
tastytea 2020-10-31 13:28:45 +01:00
parent 5b82bb0ef0
commit 4e9e750e35
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 2 additions and 2 deletions

View File

@ -78,7 +78,7 @@ int main()
Message::Message() Message::Message()
{ {
// Read message length. // Read message length.
uint32_t length; uint32_t length{0};
char buffer[4]; char buffer[4];
cin.read(buffer, sizeof(length)); cin.read(buffer, sizeof(length));
std::memcpy(&length, buffer, sizeof(length)); std::memcpy(&length, buffer, sizeof(length));
@ -88,7 +88,7 @@ Message::Message()
cin.ignore(1); cin.ignore(1);
// Read message. // Read message.
char c; char c{'\0'};
for (; length > 0; --length) for (; length > 0; --length)
{ {
cin.read(&c, 1); cin.read(&c, 1);