X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=lib-sys%2Funix.c;h=905443578ca4a1e79612d15a8bb121cffcd3a5b9;hb=05e61a9707a6da5c0bca77aa7c3c019a918494de;hp=4f189c1045e47206fffcce29204ab5b64fc2133e;hpb=d23094706c228c63c7c7ab8f337fb5dd886c4109;p=apps%2Fmadmutt.git diff --git a/lib-sys/unix.c b/lib-sys/unix.c index 4f189c1..9054435 100644 --- a/lib-sys/unix.c +++ b/lib-sys/unix.c @@ -8,16 +8,7 @@ * please see the file GPL in the top level source directory. */ -#include -#include -#include -#include -#include - -#include -#include -#include -#include +#include #include "unix.h" #include "mutt_signal.h" @@ -40,7 +31,7 @@ ssize_t mutt_gecos_name(char *dst, ssize_t n, struct passwd *pw, rx_t *rx) if (!pw->pw_gecos) return 0; - if (rx) { + if (rx->rx) { regmatch_t pat_match[1]; if (regexec(rx->rx, pw->pw_gecos, 1, pat_match, 0)) { @@ -183,8 +174,8 @@ 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); - safe_fclose(&f); + m_strncpy(s, n, p, q - trailing_dot - p); + m_fclose(&f); return 0; } @@ -192,6 +183,6 @@ int getdnsdomainname(char *s, ssize_t n) } } - safe_fclose (&f); + m_fclose(&f); return -1; }