X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=lib-sys%2Funix.c;h=a83d4bcf96ee99b4122ddcdb2d25b1b9a0841f3f;hb=40fc05e11b8f95a9661e6e410a9e7b7da7824891;hp=4f189c1045e47206fffcce29204ab5b64fc2133e;hpb=d23094706c228c63c7c7ab8f337fb5dd886c4109;p=apps%2Fmadmutt.git diff --git a/lib-sys/unix.c b/lib-sys/unix.c index 4f189c1..a83d4bc 100644 --- a/lib-sys/unix.c +++ b/lib-sys/unix.c @@ -29,7 +29,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 +43,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 +183,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; }