Commit 10c93b2
committed
Ensure that strings copied by strncpy() are NUL-terminated
strncpy() does not guarantee that the destination buffer will be
NUL-terminated, so this change ensures that by explicitly setting the
last element to NUL.
POSIX.1-2024 defines the function strlcpy() for that purpose, but
given the standard's freshness and the limited number of occurrences
in ROBODoc's source code, it was easier just to amend the few uses.1 parent 7b24ca1 commit 10c93b2
1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
| 304 | + | |
304 | 305 | | |
305 | 306 | | |
306 | 307 | | |
307 | 308 | | |
308 | 309 | | |
| 310 | + | |
309 | 311 | | |
310 | 312 | | |
311 | 313 | | |
| |||
329 | 331 | | |
330 | 332 | | |
331 | 333 | | |
| 334 | + | |
332 | 335 | | |
333 | 336 | | |
334 | 337 | | |
| |||
370 | 373 | | |
371 | 374 | | |
372 | 375 | | |
| 376 | + | |
373 | 377 | | |
374 | 378 | | |
375 | 379 | | |
| |||
559 | 563 | | |
560 | 564 | | |
561 | 565 | | |
| 566 | + | |
562 | 567 | | |
| 568 | + | |
563 | 569 | | |
| 570 | + | |
564 | 571 | | |
| 572 | + | |
565 | 573 | | |
566 | 574 | | |
567 | 575 | | |
| |||
0 commit comments