shared/utmp-wtmp: silence gcc warning about strncpy truncation
Unfortunately the warning must be known, or otherwise the pragma generates a warning or an error. So let's do a meson check for it. Is it worth doing this to silence the warning? I think so, because apparently the warning was already emitted by gcc-8.1, and with the recent push in gcc to catch more such cases, we'll most likely only get more of those.
This commit is contained in:
@@ -209,7 +209,7 @@ int utmp_put_init_process(const char *id, pid_t pid, pid_t sid, const char *line
|
||||
copy_suffix(store.ut_id, sizeof(store.ut_id), id);
|
||||
|
||||
if (line)
|
||||
strncpy(store.ut_line, basename(line), sizeof(store.ut_line));
|
||||
strncpy_exact(store.ut_line, line, sizeof(store.ut_line));
|
||||
|
||||
r = write_entry_both(&store);
|
||||
if (r < 0)
|
||||
|
||||
Reference in New Issue
Block a user