X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-sys%2Funix.c;h=30a75dc60cf4afc2b48e227b20ad66b26ec8ae39;hp=4f189c1045e47206fffcce29204ab5b64fc2133e;hb=230399f9632c37b66c1c117a17e8327eae6b3235;hpb=d23094706c228c63c7c7ab8f337fb5dd886c4109 diff --git a/lib-sys/unix.c b/lib-sys/unix.c index 4f189c1..30a75dc 100644 --- a/lib-sys/unix.c +++ b/lib-sys/unix.c @@ -14,10 +14,7 @@ #include #include -#include -#include -#include -#include +#include #include "unix.h" #include "mutt_signal.h" @@ -29,7 +26,7 @@ * otherwise assume that the GECOS field is a comma-separated list. * Replace "&" by a capitalized version of the user's login name. */ -ssize_t mutt_gecos_name(char *dst, ssize_t n, struct passwd *pw, rx_t *rx) +ssize_t mutt_gecos_name(char *dst, ssize_t n, struct passwd *pw, regex_t *rx) { const char *p, *end; ssize_t len; @@ -43,7 +40,7 @@ ssize_t mutt_gecos_name(char *dst, ssize_t n, struct passwd *pw, rx_t *rx) if (rx) { regmatch_t pat_match[1]; - if (regexec(rx->rx, pw->pw_gecos, 1, pat_match, 0)) { + if (regexec(rx, pw->pw_gecos, 1, pat_match, 0)) { return 0; } @@ -183,7 +180,7 @@ int getdnsdomainname(char *s, ssize_t n) trailing_dot = q[-1] == '.'; if (!trailing_dot || q > p + 1) { - m_strncpy(s, n, p, p - q - trailing_dot); + m_strncpy(s, n, p, q - trailing_dot - p); safe_fclose(&f); return 0; }