diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9707eca..f2af2e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v7 - name: Install Arduino IDE run: | diff --git a/cores/arduino/WString.cpp b/cores/arduino/WString.cpp index dd5e2b2..2955561 100644 --- a/cores/arduino/WString.cpp +++ b/cores/arduino/WString.cpp @@ -334,14 +334,16 @@ unsigned char String::concat(unsigned long num) unsigned char String::concat(float num) { - char buf[20]; + static size_t const FLOAT_BUF_SIZE = (FLT_MAX_10_EXP + 1) + 2 /* FIXED DECIMAL PLACES */ + 1 /* '-' */ + 1 /* '.' */ + 1 /* '\0' */; + char buf[FLOAT_BUF_SIZE]; char* string = dtostrf(num, 4, 2, buf); return concat(string, strlen(string)); } unsigned char String::concat(double num) { - char buf[20]; + static size_t const DOUBLE_BUF_SIZE = (DBL_MAX_10_EXP + 1) + 2 /* FIXED DECIMAL PLACES */ + 1 /* '-' */ + 1 /* '.' */ + 1 /* '\0' */; + char buf[DOUBLE_BUF_SIZE]; char* string = dtostrf(num, 4, 2, buf); return concat(string, strlen(string)); } diff --git a/platform.txt b/platform.txt index 8c4f5eb..34875da 100644 --- a/platform.txt +++ b/platform.txt @@ -6,7 +6,7 @@ # https://arduino.github.io/arduino-cli/latest/platform-specification/ name=XInput AVR Boards -version=1.0.6 +version=1.0.7 # AVR compile variables # ---------------------