Skip to content

Commit 208077e

Browse files
committed
Fix RELEASE build
error: 'char* strncpy(char*, const char*, size_t)' accessing 0 or more bytes at offsets [0, 2147483647] and [0, 2147483647] may overlap up to 4294967295 bytes at offset [6442450941, 2147483647] [-Werror=restrict] strncpy(writeTo, buffer + index + count,len - index);
1 parent bbe3dd0 commit 208077e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arduino/cores/esp32/WString.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ void String::remove(unsigned int index, unsigned int count){
638638
if (count > len - index) { count = len - index; }
639639
char *writeTo = buffer + index;
640640
len = len - count;
641-
strncpy(writeTo, buffer + index + count,len - index);
641+
memmove(writeTo, buffer + index + count, len - index);
642642
buffer[len] = 0;
643643
}
644644

0 commit comments

Comments
 (0)