Skip to content

Commit 3d8fbdf

Browse files
committed
Limiting max. precision in dtostrf()
1 parent 372569a commit 3d8fbdf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/MySensors/core/MyMessage.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ char* MyMessage::getString(char *buffer) const {
100100
} else if (payloadType == P_ULONG32) {
101101
ultoa(ulValue, buffer, 10);
102102
} else if (payloadType == P_FLOAT32) {
103-
dtostrf(fValue,2,fPrecision,buffer);
103+
dtostrf(fValue,2,min(fPrecision, 8),buffer);
104104
} else if (payloadType == P_CUSTOM) {
105105
return getCustomString(buffer);
106106
}

0 commit comments

Comments
 (0)