This call was way too clever. It relied on the last byte of fail_line
being 0 due to it being in a static structure and never writing to it.
Write an explicit terminating null byte, by using STRTCPY().
Cc: Matthew House <mattlloydhouse@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
#include "failure.h"
#include "memzero.h"
#include "prototypes.h"
+#include "strtcpy.h"
#define YEAR (365L*DAY)
fl->fail_cnt++;
}
- strncpy (fl->fail_line, tty, sizeof (fl->fail_line) - 1);
+ STRTCPY(fl->fail_line, tty);
(void) time (&fl->fail_time);
/*