mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2026-01-26 06:14:28 +00:00
lnstat_util: Make sure buffer is NUL-terminated
Can't use strlcpy() here since lnstat is not linked against libutil. While being at it, fix coding style in that chunk as well. Signed-off-by: Phil Sutter <phil@nwl.cc>
This commit is contained in:
parent
9376314b49
commit
bc4a57b879
@ -150,7 +150,8 @@ static int lnstat_scan_compat_rtstat_fields(struct lnstat_file *lf)
|
||||
{
|
||||
char buf[FGETS_BUF_SIZE];
|
||||
|
||||
strncpy(buf, RTSTAT_COMPAT_LINE, sizeof(buf)-1);
|
||||
strncpy(buf, RTSTAT_COMPAT_LINE, sizeof(buf) - 1);
|
||||
buf[sizeof(buf) - 1] = '\0';
|
||||
|
||||
return __lnstat_scan_fields(lf, buf);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user