diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2012-02-28 20:40:24 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2012-02-28 20:40:24 +0000 |
commit | bb85d083a7899890d0c14502078f6fa60a09d5df (patch) | |
tree | 64639b9495a86414aa0cc92917145b41a5f1562e /Demos | |
parent | b762780343dd505f7bfe5673cbcffb0b938d7064 (diff) | |
download | lufa-bb85d083a7899890d0c14502078f6fa60a09d5df.tar.gz lufa-bb85d083a7899890d0c14502078f6fa60a09d5df.tar.bz2 lufa-bb85d083a7899890d0c14502078f6fa60a09d5df.zip |
Fix warnings and errors found by the new cppcheck provided static code analysis.
Diffstat (limited to 'Demos')
-rw-r--r-- | Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c index 15b98215c..a02a66b7b 100644 --- a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c +++ b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c @@ -473,8 +473,8 @@ static inline void Bluetooth_Signal_ConnectionReq(const BT_Signal_Header_t* cons ResponsePacket.SignalCommandHeader.Length = sizeof(ResponsePacket.ConnectionResponse); /* Fill out the Connection Response in the response packet */ - ResponsePacket.ConnectionResponse.DestinationChannel = ChannelData->LocalNumber; - ResponsePacket.ConnectionResponse.SourceChannel = ChannelData->RemoteNumber; + ResponsePacket.ConnectionResponse.DestinationChannel = (ChannelData != NULL) ? ChannelData->LocalNumber : 0; + ResponsePacket.ConnectionResponse.SourceChannel = (ChannelData != NULL) ? ChannelData->RemoteNumber : 0; ResponsePacket.ConnectionResponse.Result = ChannelStatus; ResponsePacket.ConnectionResponse.Status = 0x00; @@ -576,7 +576,7 @@ static inline void Bluetooth_Signal_ConfigurationReq(const BT_Signal_Header_t* c ResponsePacket.SignalCommandHeader.Length = sizeof(ResponsePacket.ConfigurationResponse); /* Fill out the Configuration Response in the response packet */ - ResponsePacket.ConfigurationResponse.SourceChannel = ChannelData->RemoteNumber; + ResponsePacket.ConfigurationResponse.SourceChannel = (ChannelData != NULL) ? ChannelData->RemoteNumber : 0; ResponsePacket.ConfigurationResponse.Flags = 0x00; ResponsePacket.ConfigurationResponse.Result = (ChannelData != NULL) ? BT_CONFIGURATION_SUCCESSFUL : BT_CONFIGURATION_REJECTED; @@ -681,8 +681,8 @@ static inline void Bluetooth_Signal_DisconnectionReq(const BT_Signal_Header_t* c ResponsePacket.SignalCommandHeader.Length = sizeof(ResponsePacket.DisconnectionResponse); /* Fill out the Disconnection Response in the response packet */ - ResponsePacket.DisconnectionResponse.DestinationChannel = ChannelData->RemoteNumber; - ResponsePacket.DisconnectionResponse.SourceChannel = ChannelData->LocalNumber; + ResponsePacket.DisconnectionResponse.DestinationChannel = (ChannelData != NULL) ? ChannelData->RemoteNumber : 0; + ResponsePacket.DisconnectionResponse.SourceChannel = (ChannelData != NULL) ? ChannelData->LocalNumber : 0; Bluetooth_SendPacket(&ResponsePacket, sizeof(ResponsePacket), NULL); |