From 7f91418a1b2a4eedf7b9040b16653e1607f020bd Mon Sep 17 00:00:00 2001 From: Matt Jenkins Date: Sun, 1 Jul 2018 10:38:01 +0100 Subject: [PATCH] Compensate for snprintf including NULL in width parameter and dtostrf not including NULL in width parameter --- pic32/cores/pic32/WString.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pic32/cores/pic32/WString.cpp b/pic32/cores/pic32/WString.cpp index 9119b0e7..05857411 100644 --- a/pic32/cores/pic32/WString.cpp +++ b/pic32/cores/pic32/WString.cpp @@ -28,7 +28,7 @@ /*********************************************/ char *dtostrf(double __val, signed char __width, unsigned char __prec, char *__s) { - snprintf(__s, __width, "%.*f", __prec, __val); + snprintf(__s, __width + 1, "%.*f", __prec, __val); return __s; }