Merge pull request #47 from lategoodbye/master

Add missing initialization
This commit is contained in:
Robert Johansson 2013-05-04 07:21:23 -07:00
commit d6ac241d2f
2 changed files with 8 additions and 2 deletions

View File

@ -1585,6 +1585,8 @@ int mbus_purge_frames(mbus_handle *handle)
int err, received; int err, received;
mbus_frame reply; mbus_frame reply;
memset((void *)&reply, 0, sizeof(mbus_frame));
received = 0; received = 0;
while (1) while (1)
{ {
@ -2034,6 +2036,7 @@ mbus_select_secondary_address(mbus_handle * handle, const char *mask)
return MBUS_PROBE_ERROR; return MBUS_PROBE_ERROR;
} }
memset((void *)&reply, 0, sizeof(mbus_frame));
ret = mbus_recv_frame(handle, &reply); ret = mbus_recv_frame(handle, &reply);
if (ret == MBUS_RECV_RESULT_TIMEOUT) if (ret == MBUS_RECV_RESULT_TIMEOUT)
@ -2094,6 +2097,7 @@ mbus_probe_secondary_address(mbus_handle * handle, const char *mask, char *match
return MBUS_PROBE_ERROR; return MBUS_PROBE_ERROR;
} }
memset((void *)&reply, 0, sizeof(mbus_frame));
ret = mbus_recv_frame(handle, &reply); ret = mbus_recv_frame(handle, &reply);
if (ret == MBUS_RECV_RESULT_TIMEOUT) if (ret == MBUS_RECV_RESULT_TIMEOUT)

View File

@ -3703,6 +3703,8 @@ mbus_frame_xml(mbus_frame *frame)
if (frame) if (frame)
{ {
memset((void *)&frame_data, 0, sizeof(mbus_frame_data));
if (mbus_frame_data_parse(frame, &frame_data) == -1) if (mbus_frame_data_parse(frame, &frame_data) == -1)
{ {
mbus_error_str_set("M-bus data parse error."); mbus_error_str_set("M-bus data parse error.");