-#include <errno.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-#include <lib-lib/macros.h>
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/file.h>
+#include <lib-lib/lib-lib.h>
regmatch_t pat_match[1];
if (regexec(rx->rx, pw->pw_gecos, 1, pat_match, 0)) {
regmatch_t pat_match[1];
if (regexec(rx->rx, pw->pw_gecos, 1, pat_match, 0)) {
- len += m_strncpy(dst + len, n - len, p, q - p);
+ len += m_strncpy(dst + len, n - len, p, MIN(end, q) - p);
trailing_dot = q[-1] == '.';
if (!trailing_dot || q > p + 1) {
m_strncpy(s, n, p, q - trailing_dot - p);
trailing_dot = q[-1] == '.';
if (!trailing_dot || q > p + 1) {
m_strncpy(s, n, p, q - trailing_dot - p);