Correct the sizeof() arg to memset call in test fixture. Ref #541.

This commit is contained in:
John M. Penn 2018-01-10 14:27:46 -06:00
parent 5db74dc804
commit 020dd0c1c9

View File

@ -19,7 +19,7 @@ class TCConnectTest : public testing::Test {
/* device */
device = (TCDevice *) malloc(sizeof(TCDevice));
memset( (void *)device,'\0',sizeof(device) );
memset( (void *)device,'\0',sizeof(TCDevice) );
device->hostname = strdup("127.0.0.1");
device->disabled = TC_COMM_FALSE;
device->disable_handshaking = TC_COMM_DISABLED;
@ -29,6 +29,7 @@ class TCConnectTest : public testing::Test {
void TearDown(){
free(device->hostname);
free(device);
}
};