core: state: Ensure compiler FSM to zeroed
Signed-off-by: Chloe M. <chloe@mirocom.org>
This commit is contained in:
+1
-1
@@ -18,6 +18,7 @@ state_init(struct cescal_state *state, const char *pathname)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
memset(state, 0, sizeof(*state));
|
||||||
state->in_fd = open(pathname, O_RDONLY);
|
state->in_fd = open(pathname, O_RDONLY);
|
||||||
if (state->in_fd < 0) {
|
if (state->in_fd < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
@@ -38,7 +39,6 @@ state_init(struct cescal_state *state, const char *pathname)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
state->pass = 0;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user