From 18da1add170065091118e7379b58d1e385faf0cd Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Sun, 12 Nov 2006 15:39:03 +0100 Subject: [PATCH 1/1] oops, bad formula Signed-off-by: Pierre Habouzit --- lib-sys/unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib-sys/unix.c b/lib-sys/unix.c index 4f189c1..8a1b860 100644 --- a/lib-sys/unix.c +++ b/lib-sys/unix.c @@ -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; } -- 2.20.1