mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[hal] Ensure HAL status variables are initialized to zero (#3421)
HAL functions don't set the status variable on success, so it's possible to use the status variable in an uninitialized state.
This commit is contained in:
@@ -125,7 +125,7 @@ void Relay::Set(Relay::Value value) {
|
||||
|
||||
Relay::Value Relay::Get() const {
|
||||
Relay::Value value = kOff;
|
||||
int32_t status;
|
||||
int32_t status = 0;
|
||||
|
||||
if (m_direction == kForwardOnly) {
|
||||
if (HAL_GetRelay(m_forwardHandle, &status)) {
|
||||
|
||||
Reference in New Issue
Block a user