mirror of
https://github.com/neovim/neovim.git
synced 2026-05-28 15:55:34 +00:00
build: strncat warning in buf_write #39684
To make gcc happy
```
src/nvim/bufwrite.c: In function ‘buf_write’:
src/nvim/bufwrite.c:1674:5: warning: ‘strncat’ specified bound depends
on the length of the source argument [-Wstringop-overflow=]
1674 | strncat(msg_id + 14, IObuff, strlen(IObuff) - 1);
| ^
src/nvim/bufwrite.c:1674:34: note: length computed here
1674 | strncat(msg_id + 14, IObuff, strlen(IObuff) - 1);
| ^
src/nvim/fileio.c: In function ‘filemess’:
src/nvim/fileio.c:137:5: warning: ‘strncat’ specified bound depends on
the length of the source argument [-Wstringop-overflow=]
137 | strncat(msg_id + 14, IObuff, strlen(IObuff) - 1);
| ^
src/nvim/fileio.c:137:34: note: length computed here
137 | strncat(msg_id + 14, IObuff, strlen(IObuff) - 1);
| ^
```
This commit is contained in:
@@ -1669,9 +1669,9 @@ restore_backup:
|
||||
#endif
|
||||
if (!filtering) {
|
||||
add_quoted_fname(IObuff, IOSIZE, buf, fname);
|
||||
// Append the filename to the message ID.
|
||||
// Append the filename (without trailing char) to the message ID.
|
||||
char msg_id[IOSIZE + 14] = "nvim.bufwrite ";
|
||||
strncat(msg_id + 14, IObuff, strlen(IObuff) - 1);
|
||||
xstrlcat(msg_id, IObuff, 14 + strlen(IObuff));
|
||||
bool insert_space = false;
|
||||
if (write_info.bw_conv_error) {
|
||||
xstrlcat(IObuff, _(" CONVERSION ERROR"), IOSIZE);
|
||||
|
||||
Reference in New Issue
Block a user