This repository has been archived by the owner on Nov 11, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test change only: fix silly strncpy() compilation error for ESP-IDF/G…
…CC 8. (#1167) With later versions of GCC, as used by later versions of ESP-IDF, an exceptionally irritating new error has been introduced: error: 'strncpy' specified bound equals destination size [-Werror=stringop-truncation] This will occur anywhere that the compiler knows (a) the size of the destination buffer and (b) the value of "n", and the two are the same (e.g. likely because "n" is sizeof(buffer)). This is extremely irritating because, despite the fact that your buffers are correctly dimensioned and the things you are copying are genuine strings, you have to reduce "n" by one and add another pointless line of code putting a terminator on the end of an already-terminated string. Anyway, enough moaning: in the three cases in the test code where this error is emitted strncpy() is now replaced by memcpy(). Our thanks to jcradavelli for highlighting this issue.
- Loading branch information