summaryrefslogtreecommitdiff
path: root/x11/kdebase3/patches
diff options
context:
space:
mode:
authorrillig <rillig>2007-03-08 14:38:31 +0000
committerrillig <rillig>2007-03-08 14:38:31 +0000
commit936755de93fb51c18fa054e5e623aba135d4cf82 (patch)
treeef7893fbc2a6ab96063b14e616af46ff1aded23c /x11/kdebase3/patches
parent9286355bf2a1ca60dc6aa1aec057588a7ed67b74 (diff)
downloadpkgsrc-936755de93fb51c18fa054e5e623aba135d4cf82.tar.gz
Using offsetof() instead of a null pointer dereference fixes a g++ error
message. Fixes PR 35950.
Diffstat (limited to 'x11/kdebase3/patches')
-rw-r--r--x11/kdebase3/patches/patch-kdesud18
1 files changed, 18 insertions, 0 deletions
diff --git a/x11/kdebase3/patches/patch-kdesud b/x11/kdebase3/patches/patch-kdesud
new file mode 100644
index 00000000000..4e8f94ec46a
--- /dev/null
+++ b/x11/kdebase3/patches/patch-kdesud
@@ -0,0 +1,18 @@
+$NetBSD: patch-kdesud,v 1.1 2007/03/08 14:38:31 rillig Exp $
+
+g++ 4.1.2 says:
+kdesud.cpp:210: error: cast from 'char*' to 'socklen_t' loses precision
+
+--- kdesu/kdesud/kdesud.cpp.orig 2005-09-10 10:26:13.000000000 +0200
++++ kdesu/kdesud/kdesud.cpp 2007-03-08 15:18:25.000000000 +0100
+@@ -77,8 +77,8 @@
+ #include <X11/Xlib.h>
+
+ #ifndef SUN_LEN
+-#define SUN_LEN(ptr) ((kde_socklen_t) (((struct sockaddr_un *) 0)->sun_path) \
+- + strlen ((ptr)->sun_path))
++#define SUN_LEN(ptr) ((kde_socklen_t) \
++ (offsetof(struct sockaddr_un, sun_path) + strlen ((ptr)->sun_path)))
+ #endif
+
+ #define ERR strerror(errno)