mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +00:00
Fixed current and potential bugs caught by Coverity
Change-Id: I9f9d09dc797ffea062eeb49c881be1d5acb63d7b
This commit is contained in:
committed by
Peter Johnson
parent
b0fec4089b
commit
055ee09825
@@ -11,6 +11,7 @@
|
||||
#include "WPIErrors.h"
|
||||
#include "LiveWindow/LiveWindow.h"
|
||||
|
||||
#include <limits>
|
||||
#include <sstream>
|
||||
|
||||
/**
|
||||
@@ -25,6 +26,7 @@ DigitalInput::DigitalInput(uint32_t channel) {
|
||||
if (!CheckDigitalChannel(channel)) {
|
||||
buf << "Digital Channel " << channel;
|
||||
wpi_setWPIErrorWithContext(ChannelIndexOutOfRange, buf.str());
|
||||
m_channel = std::numeric_limits<uint32_t>::max();
|
||||
return;
|
||||
}
|
||||
m_channel = channel;
|
||||
|
||||
Reference in New Issue
Block a user