From 8dc5c7062c81c8bc8fc2d23ca4c42d25c37774d6 Mon Sep 17 00:00:00 2001
From: Reinhold Kainhofer <reinhold@kainhofer.com>
Date: Sun, 29 Oct 2017 21:40:06 +0100
Subject: [PATCH] Fix some more compiler warnings (missing return value)

---
 NodeManager.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/NodeManager.cpp b/NodeManager.cpp
index 330952b..19515b2 100644
--- a/NodeManager.cpp
+++ b/NodeManager.cpp
@@ -3350,7 +3350,7 @@ int NodeManager::registerSensor(int sensor_type, int pin, int child_id) {
 
 // attach a built-in or custom sensor to this manager
 int NodeManager::registerSensor(Sensor* sensor) {
-  if (sensor->getChildId() > MAX_SENSORS) return;
+  if (sensor->getChildId() > MAX_SENSORS) return -1;
   #if DEBUG == 1
     Serial.print(F("REG I="));
     Serial.print(sensor->getChildId());
@@ -3390,7 +3390,7 @@ Sensor* NodeManager::getSensor(int child_id) {
 
 // assign a different child id to a sensor'
 bool NodeManager::renameSensor(int old_child_id, int new_child_id) {
-  if (old_child_id > MAX_SENSORS || new_child_id > MAX_SENSORS) return;
+  if (old_child_id > MAX_SENSORS || new_child_id > MAX_SENSORS) return false;
   // ensure the old id exists and the new is available
   if (_sensors[old_child_id] == 0 || _sensors[new_child_id] != 0) return false;
   // assign the sensor to new id
-- 
GitLab