Commit 52924e9
committed
Avoid memcpy()-ing 0-length vectors
The C standard (before C23) says that giving invalid pointers, even with
length=0, to memcpy() is undefined behaviour. R returns an invalid
pointer for vectors of length 0, so avoid calls to memcpy() altogether
in such cases.1 parent f231b5d commit 52924e9
2 files changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
535 | 535 | | |
536 | 536 | | |
537 | 537 | | |
538 | | - | |
| 538 | + | |
539 | 539 | | |
540 | 540 | | |
541 | 541 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
| 225 | + | |
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| |||
0 commit comments