diff options
author | Mike Gilbert <floppym@gentoo.org> | 2024-05-31 16:22:11 -0400 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2024-06-03 14:50:37 -0500 |
commit | 70be1c02005b6d7a4805db57c2183fa32513ac46 (patch) | |
tree | da8d6b0181c5675c27285311e295bfe01fc9686c /src/rc-abort/rc-abort.c | |
parent | 3d30b6fddaf92c612deea88d2ced7114ed1fcf9c (diff) |
librc: avoid using fixed-size buffers for paths
Use heap allocations instead. This avoids warnings:
```
../src/librc/librc.c: In function ‘rc_service_mark’:
../src/librc/librc.c:817:58: warning: ‘/’ directive output may be truncated writing 1 byte into a region of size between 0 and 4095 [-Wformat-truncation=]
817 | snprintf(was, sizeof(was), "%s/%s/%s",
| ^
../src/librc/librc.c:817:25: note: ‘snprintf’ output 3 or more bytes (assuming 4098) into a destination of size 4096
817 | snprintf(was, sizeof(was), "%s/%s/%s",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
818 | file, dir->value, base);
| ~~~~~~~~~~~~~~~~~~~~~~~
../src/librc/librc.c:822:58: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=]
822 | snprintf(was, sizeof(was), "%s/%s", file, dir->value);
| ^
../src/librc/librc.c:822:25: note: ‘snprintf’ output 2 or more bytes (assuming 4097) into a destination of size 4096
822 | snprintf(was, sizeof(was), "%s/%s", file, dir->value);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
Diffstat (limited to 'src/rc-abort/rc-abort.c')
0 files changed, 0 insertions, 0 deletions