浏览代码

conditions are hard

Chris Mullins 8 年之前
父节点
当前提交
512720dfcf
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      lib/MiLight/MiLightUdpServer.cpp

+ 1 - 1
lib/MiLight/MiLightUdpServer.cpp

@@ -23,7 +23,7 @@ void MiLightUdpServer::handleClient() {
   const size_t packetSize = socket.parsePacket();
   
   if (packetSize) {
-    if (packetSize < 2 || packetSize > 3) {
+    if (packetSize >= 2 && packetSize <= 3) {
       socket.read(packetBuffer, packetSize);
       handleCommand(packetBuffer[0], packetBuffer[1]);
     } else {