Commit 5d7594b
committed
Use memmove in String::remove
Before, it used strncpy, but that has undefined behaviour when the
source and destination strings overlap. memove is guaranteed to work
correctly in this case.
Note that memmove simply copies all bytes, whereas strncpy stopped at
the first nul-byte. This means this commit also makes remove work for
strings that contain embedded nul bytes.1 parent c21bea8 commit 5d7594b
File tree
2 files changed
+2
-2
lines changed- hardware/arduino
- avr/cores/arduino
- sam/cores/arduino
2 files changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
696 | 696 | | |
697 | 697 | | |
698 | 698 | | |
699 | | - | |
| 699 | + | |
700 | 700 | | |
701 | 701 | | |
702 | 702 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
698 | 698 | | |
699 | 699 | | |
700 | 700 | | |
701 | | - | |
| 701 | + | |
702 | 702 | | |
703 | 703 | | |
704 | 704 | | |
| |||
0 commit comments