Skip to content

Commit 43e6242

Browse files
committed
Minor fixes for ds18b20 sensors (#328)
1 parent 264b790 commit 43e6242

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

NodeManagerLibrary.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1760,7 +1760,7 @@ void SensorDs18b20::setSleepDuringConversion(bool value) {
17601760

17611761
// return the address of a device
17621762
char* SensorDs18b20::_getAddress(int index) {
1763-
char* charAddr = " ";
1763+
char* charAddr = new char[17];
17641764
DeviceAddress device_address;
17651765
_sensors->getAddress(device_address,index);
17661766
String strAddr = String(device_address[0], HEX);
@@ -1772,6 +1772,7 @@ char* SensorDs18b20::_getAddress(int index) {
17721772
strAddr.toUpperCase();
17731773
}
17741774
for (int j = 0; j < 16; j++) charAddr[j] = strAddr[j];
1775+
charAddr[16] = 0;
17751776
return charAddr;
17761777
}
17771778
#endif

0 commit comments

Comments
 (0)