summaryrefslogtreecommitdiff
path: root/x11/xmx
diff options
context:
space:
mode:
authordholland <dholland@pkgsrc.org>2008-08-31 06:52:29 +0000
committerdholland <dholland@pkgsrc.org>2008-08-31 06:52:29 +0000
commit019aff8e2035a6abec6033e0f306c5c11e0c4cc3 (patch)
tree5f73ec1beb7c26299fd3a80cfbbe53db6ec95e73 /x11/xmx
parentee7505eb75b4adfc673a59c9adf7ca55e05a2b6e (diff)
downloadpkgsrc-019aff8e2035a6abec6033e0f306c5c11e0c4cc3.tar.gz
Fix the "minor PLIST problems" and unmark this as only for SunOS.
Add proper deps. Add destdir support. And, finally, make it build properly. (82 (small) patches later...)
Diffstat (limited to 'x11/xmx')
-rw-r--r--x11/xmx/Makefile11
-rw-r--r--x11/xmx/PLIST6
-rw-r--r--x11/xmx/distinfo84
-rw-r--r--x11/xmx/patches/patch-aa12
-rw-r--r--x11/xmx/patches/patch-ab13
-rw-r--r--x11/xmx/patches/patch-ac12
-rw-r--r--x11/xmx/patches/patch-ad13
-rw-r--r--x11/xmx/patches/patch-ae12
-rw-r--r--x11/xmx/patches/patch-af13
-rw-r--r--x11/xmx/patches/patch-ag13
-rw-r--r--x11/xmx/patches/patch-ah14
-rw-r--r--x11/xmx/patches/patch-ai13
-rw-r--r--x11/xmx/patches/patch-aj12
-rw-r--r--x11/xmx/patches/patch-ak12
-rw-r--r--x11/xmx/patches/patch-al12
-rw-r--r--x11/xmx/patches/patch-am12
-rw-r--r--x11/xmx/patches/patch-ba15
-rw-r--r--x11/xmx/patches/patch-bb12
-rw-r--r--x11/xmx/patches/patch-bc12
-rw-r--r--x11/xmx/patches/patch-bd28
-rw-r--r--x11/xmx/patches/patch-be12
-rw-r--r--x11/xmx/patches/patch-bf14
-rw-r--r--x11/xmx/patches/patch-bg12
-rw-r--r--x11/xmx/patches/patch-bh21
-rw-r--r--x11/xmx/patches/patch-bi37
-rw-r--r--x11/xmx/patches/patch-bj21
-rw-r--r--x11/xmx/patches/patch-bk12
-rw-r--r--x11/xmx/patches/patch-bl13
-rw-r--r--x11/xmx/patches/patch-bm12
-rw-r--r--x11/xmx/patches/patch-bn27
-rw-r--r--x11/xmx/patches/patch-bo66
-rw-r--r--x11/xmx/patches/patch-bp12
-rw-r--r--x11/xmx/patches/patch-bq77
-rw-r--r--x11/xmx/patches/patch-br12
-rw-r--r--x11/xmx/patches/patch-bs60
-rw-r--r--x11/xmx/patches/patch-bt12
-rw-r--r--x11/xmx/patches/patch-bu20
-rw-r--r--x11/xmx/patches/patch-bv12
-rw-r--r--x11/xmx/patches/patch-bw13
-rw-r--r--x11/xmx/patches/patch-bx14
-rw-r--r--x11/xmx/patches/patch-by32
-rw-r--r--x11/xmx/patches/patch-bz13
-rw-r--r--x11/xmx/patches/patch-ca12
-rw-r--r--x11/xmx/patches/patch-cb12
-rw-r--r--x11/xmx/patches/patch-cc13
-rw-r--r--x11/xmx/patches/patch-cd12
-rw-r--r--x11/xmx/patches/patch-ce13
-rw-r--r--x11/xmx/patches/patch-cf12
-rw-r--r--x11/xmx/patches/patch-cg13
-rw-r--r--x11/xmx/patches/patch-ch13
-rw-r--r--x11/xmx/patches/patch-ci13
-rw-r--r--x11/xmx/patches/patch-cj12
-rw-r--r--x11/xmx/patches/patch-ck12
-rw-r--r--x11/xmx/patches/patch-cl28
-rw-r--r--x11/xmx/patches/patch-cm14
-rw-r--r--x11/xmx/patches/patch-cn12
-rw-r--r--x11/xmx/patches/patch-co12
-rw-r--r--x11/xmx/patches/patch-cp12
-rw-r--r--x11/xmx/patches/patch-cq33
-rw-r--r--x11/xmx/patches/patch-cr12
-rw-r--r--x11/xmx/patches/patch-cs12
-rw-r--r--x11/xmx/patches/patch-ct13
-rw-r--r--x11/xmx/patches/patch-cu20
-rw-r--r--x11/xmx/patches/patch-cv23
-rw-r--r--x11/xmx/patches/patch-cw12
-rw-r--r--x11/xmx/patches/patch-cx12
-rw-r--r--x11/xmx/patches/patch-cy13
-rw-r--r--x11/xmx/patches/patch-cz13
-rw-r--r--x11/xmx/patches/patch-da12
-rw-r--r--x11/xmx/patches/patch-db41
-rw-r--r--x11/xmx/patches/patch-dc12
-rw-r--r--x11/xmx/patches/patch-dd12
-rw-r--r--x11/xmx/patches/patch-de21
-rw-r--r--x11/xmx/patches/patch-df12
-rw-r--r--x11/xmx/patches/patch-dg14
-rw-r--r--x11/xmx/patches/patch-dh14
-rw-r--r--x11/xmx/patches/patch-di12
-rw-r--r--x11/xmx/patches/patch-dj13
-rw-r--r--x11/xmx/patches/patch-dk12
-rw-r--r--x11/xmx/patches/patch-ea13
-rw-r--r--x11/xmx/patches/patch-eb12
-rw-r--r--x11/xmx/patches/patch-ec13
-rw-r--r--x11/xmx/patches/patch-ed28
-rw-r--r--x11/xmx/patches/patch-ee12
-rw-r--r--x11/xmx/patches/patch-ef44
85 files changed, 1524 insertions, 6 deletions
diff --git a/x11/xmx/Makefile b/x11/xmx/Makefile
index 71fb3172bd4..fe3b09091fc 100644
--- a/x11/xmx/Makefile
+++ b/x11/xmx/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2006/03/04 21:31:13 jlam Exp $
+# $NetBSD: Makefile,v 1.9 2008/08/31 06:52:29 dholland Exp $
DISTNAME= xmx-2.1alpha.pl7
PKGNAME= xmx-2.1a7
@@ -10,8 +10,15 @@ MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://www.cs.brown.edu/software/xmx/
COMMENT= X11 Protocol Multiplexor
-ONLY_FOR_PLATFORM= SunOS-*-* # minor PLIST problems
+PKG_DESTDIR_SUPPORT= user-destdir
USE_IMAKE= yes
+.include "../../mk/bsd.prefs.mk"
+
+.include "../../x11/libX11/buildlink3.mk"
+.include "../../x11/xextproto/buildlink3.mk"
+.include "../../x11/libXt/buildlink3.mk"
+.include "../../x11/libXaw/buildlink3.mk"
+
.include "../../mk/bsd.pkg.mk"
diff --git a/x11/xmx/PLIST b/x11/xmx/PLIST
index 26aed4f90de..74ed6c468f6 100644
--- a/x11/xmx/PLIST
+++ b/x11/xmx/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.1 2001/10/31 22:12:24 zuntum Exp $
+@comment $NetBSD: PLIST,v 1.2 2008/08/31 06:52:29 dholland Exp $
include/XMC/xmc.h
include/XMC/xmcp.h
lib/libXmc.so
@@ -8,6 +8,6 @@ lib/libXmc_d.a
bin/xmx
bin/xmtg
bin/xmxinit
-man/man1/xmxinit.1x
-man/man1/xmx.1x
+${IMAKE_MAN_DIR}/xmxinit.${IMAKE_MANNEWSUFFIX}
+${IMAKE_MAN_DIR}/xmx.${IMAKE_MANNEWSUFFIX}
@dirrm include/XMC
diff --git a/x11/xmx/distinfo b/x11/xmx/distinfo
index 3125cb3a6d8..53519b07949 100644
--- a/x11/xmx/distinfo
+++ b/x11/xmx/distinfo
@@ -1,5 +1,87 @@
-$NetBSD: distinfo,v 1.3 2005/02/23 17:36:24 wiz Exp $
+$NetBSD: distinfo,v 1.4 2008/08/31 06:52:29 dholland Exp $
SHA1 (xmx-2.1alpha.pl7.tar.gz) = b517b20a7bfa352b12ffb7dd260d50ea6c1ec21b
RMD160 (xmx-2.1alpha.pl7.tar.gz) = 18560824a35ffc55ce90fa63d1894362afa45405
Size (xmx-2.1alpha.pl7.tar.gz) = 498352 bytes
+SHA1 (patch-aa) = b2a0495a9c85ea5fb8c5754356584fbd6b8e00d3
+SHA1 (patch-ab) = d5a8ada381f1f11dcfdfde4dee30006b03cb325a
+SHA1 (patch-ac) = e28de95a5390f55f227e4dd48cbeb5570e8875d7
+SHA1 (patch-ad) = 86b0633335735207e958a2e207b1eee4127b6d77
+SHA1 (patch-ae) = 7820c5bd24cc0a92201f05e91ae72f7681686499
+SHA1 (patch-af) = 6b4fe7e13e16270b92b1e377a01bc54d4fd1df58
+SHA1 (patch-ag) = 6d1b47ada8b9cf12e7ea7ce31154c4acdaeba9a4
+SHA1 (patch-ah) = 203cbcf742b6d7b128c7b1cdaade066532ef6bac
+SHA1 (patch-ai) = cb24f5e3d8c31a36c28683bb14f9f81f289604c8
+SHA1 (patch-aj) = e63d86b90b3949b4c27d3abee7b1e3198b2eb812
+SHA1 (patch-ak) = 871705f3c7cc87817cf96c1b771d2423e9aadcd4
+SHA1 (patch-al) = 06f54d4ee2d951264c133c18dbeaa4ae775afea2
+SHA1 (patch-am) = 6fc13f5b0dc8747263f2b69351124106da0f5065
+SHA1 (patch-ba) = 54c5546f4c3ba0d52e6784e2fbb36a2a0a2bc4c2
+SHA1 (patch-bb) = 2388da09fdf95f978c34a762d0c1cd156e5d3a39
+SHA1 (patch-bc) = 923ad684950abaa4204d32ee0763c01383a50361
+SHA1 (patch-bd) = 7dcd52874072db7801f7b885a33f4d735b8453d4
+SHA1 (patch-be) = 34b12990b8e5881344f1ede8e16232c7302b6e57
+SHA1 (patch-bf) = 8f873285b751bc867ef5b4ef114d8d2abdea0dfd
+SHA1 (patch-bg) = 471c35cde452b800bde25e552c293785c1b1840e
+SHA1 (patch-bh) = 5a88c2bf48167ac8b180a1d3736ada0ae4e40bcb
+SHA1 (patch-bi) = 335d276302ab0bff6b892b8da88a271b1cdea7f6
+SHA1 (patch-bj) = 308a1ef46c27c0df2714567608f290e5c58333da
+SHA1 (patch-bk) = f543e35d59b56755bde230b165f633e7ef61c72a
+SHA1 (patch-bl) = 10461e98674a7c2482ebe8f929bfbe2ad94de34a
+SHA1 (patch-bm) = 7caabf326ec0760a40278e2e327e5a9f5c0943b1
+SHA1 (patch-bn) = 0c14f1b5e3bad6c2b30111d8d4038741e0da0b1c
+SHA1 (patch-bo) = 2e36d03020ad81f9f4855d2b0b60b20eb98d6bd2
+SHA1 (patch-bp) = 5f0349d09b32b09beed8fc51f2e90a9c5ac7c39a
+SHA1 (patch-bq) = f2accbf98b12e2e5ffd0887d35a3f069f310bc3c
+SHA1 (patch-br) = d6f052b36f7b75b244d46cc264de5439c20c93af
+SHA1 (patch-bs) = cb5990bab1042a0a43cf942c18d38e9a7e1d388b
+SHA1 (patch-bt) = 85ebc7f12ed5493552fcaa07fd46c5761c076f91
+SHA1 (patch-bu) = 3ab48959ae5e68b1e91cb65213b4e7de875e162a
+SHA1 (patch-bv) = a81350981178d6cc5aaade8a4eeca4e77e50c75a
+SHA1 (patch-bw) = ed3afbfadebb3aa412cce24a7826518a8864aa57
+SHA1 (patch-bx) = 5d86a9f6a6050168b87b70ddfdb2fda428a2b1b9
+SHA1 (patch-by) = c8eeaa8ad48f8b94809d0403f0e551ae10f15304
+SHA1 (patch-bz) = 2b587d8c370bb9072a50cf84ba6e0560378bee18
+SHA1 (patch-ca) = 260906a9c0d4bbfce3b283048fba16b7a27fdc6d
+SHA1 (patch-cb) = e5cc6ebcbff118595dfca0b928762cb5ac913640
+SHA1 (patch-cc) = 9c1030833bb512e1d86665b96207e9e56033c23e
+SHA1 (patch-cd) = 4f9156fc8294581c22599bbf2902462bbe4d3074
+SHA1 (patch-ce) = 3258f0bdf525f2e215ebd16a64a667cab9526c65
+SHA1 (patch-cf) = ec1dcdcbba14bc1af531a74c085aef31b556ff99
+SHA1 (patch-cg) = 59bdf629f072034c77f8e74792d0dc1f72225781
+SHA1 (patch-ch) = 2470887a7d040ab8d291c47a2d1f3874b5d2b9b1
+SHA1 (patch-ci) = 8db248283633edf8bee35e8d22f2f42db4528e0d
+SHA1 (patch-cj) = 964ce187be6bb93438c4a87f03ac891c071fd3d7
+SHA1 (patch-ck) = cfab49f9f6ff948f2b8c1341f38a01b822003e5f
+SHA1 (patch-cl) = d5235ddb32c93d1288bd49332bc9aebaa13edef2
+SHA1 (patch-cm) = 2c96c8277d563e848a1948ccf9baa540c9151edc
+SHA1 (patch-cn) = f764b087b430ae128659df1fad9ef86bff026b81
+SHA1 (patch-co) = 2881849b99f6e28b758d22a50470c5dfaa2d6b5f
+SHA1 (patch-cp) = 1066d92eb2048144de9d9e158fe63d2662fd4dbb
+SHA1 (patch-cq) = da7c7861a517aada41b2e1a290a35b3e8cf540b9
+SHA1 (patch-cr) = faa9ebb6a3ae46959f9d4094283a036b9222c773
+SHA1 (patch-cs) = ff22fa56a014de0038650cd5a98e05f629f7e7d3
+SHA1 (patch-ct) = 393d43febcc3f9e8302150257bba638f73228d13
+SHA1 (patch-cu) = ae9d40bfbdc40aae05702eb897aaa7ceb9b448d6
+SHA1 (patch-cv) = 2a8f97af8726f103b2d3be8bdbd16082ae2119ac
+SHA1 (patch-cw) = 8a72417cc169b2bc58d5b77657f83b1fe7d6e392
+SHA1 (patch-cx) = dfed862cf5d48dd1f6fbfcf6b1780f45c238d0bf
+SHA1 (patch-cy) = 234c8e486f3e900d8799bd22441249df23fe831f
+SHA1 (patch-cz) = 96a21d569dfc52609219c3465de4c403bf56a206
+SHA1 (patch-da) = 3fba1ba00e8cc7accd15ea4f5bfd615700ed420e
+SHA1 (patch-db) = 049fffbce44cf4a1ea169ee8153a3bf45307be1e
+SHA1 (patch-dc) = d70975d7071b391cc3e83bd1e5e4acf8e333a00a
+SHA1 (patch-dd) = e5d2fea2ad7a8da3529a41452968e718c86dc6d1
+SHA1 (patch-de) = bdcc522ff0b97a8207965b6aee1f5a45e64425c8
+SHA1 (patch-df) = 6fb17641fa4bebf48cee656104ebb0065f663d35
+SHA1 (patch-dg) = 2f0ebab6a145546a22b495f12fffe0e60791accb
+SHA1 (patch-dh) = a6fef2ec6e7cc9abc1f2fd2e12cc6fc11cee0353
+SHA1 (patch-di) = bb54061779ff5b19c04099d552f747daa5b18be9
+SHA1 (patch-dj) = 89ee37086ac43df3e9e901fde7827f3d05369963
+SHA1 (patch-dk) = 5b9d03cf77434c369ab6aca12f36432968a9aea8
+SHA1 (patch-ea) = 44019700e7ad06bf7319926ebc804722e4d6f521
+SHA1 (patch-eb) = a867f1c4dcc653d19206b64fa396732f1ae1c88b
+SHA1 (patch-ec) = 18de9cdf60967af54721d105072dc30867a99904
+SHA1 (patch-ed) = 11c1d90ecad5bec0c92bbb4bd7b80c4056e4bcde
+SHA1 (patch-ee) = 077943c76a512a0e51e7097409ec645d43b1ba18
+SHA1 (patch-ef) = 58e1b211139aaba6f4303cec5b6a6cac98ab5b66
diff --git a/x11/xmx/patches/patch-aa b/x11/xmx/patches/patch-aa
new file mode 100644
index 00000000000..8e87762167d
--- /dev/null
+++ b/x11/xmx/patches/patch-aa
@@ -0,0 +1,12 @@
+$NetBSD: patch-aa,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- lib/Xmc/auth.c~ 1998-04-01 18:50:26.000000000 -0500
++++ lib/Xmc/auth.c 2008-08-31 00:15:32.000000000 -0400
+@@ -23,6 +23,7 @@
+ #include <sys/param.h>
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <string.h>
+ #include <xmc.h>
+ #include <xmclib.h>
+ #include <xmcp.h>
diff --git a/x11/xmx/patches/patch-ab b/x11/xmx/patches/patch-ab
new file mode 100644
index 00000000000..420e098ef01
--- /dev/null
+++ b/x11/xmx/patches/patch-ab
@@ -0,0 +1,13 @@
+$NetBSD: patch-ab,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- lib/Xmc/common.c~ 1998-04-01 18:51:21.000000000 -0500
++++ lib/Xmc/common.c 2008-08-31 00:16:29.000000000 -0400
+@@ -27,6 +27,8 @@
+ #include <sys/select.h>
+ #endif
+ #include <sys/socket.h>
++#include <stdlib.h>
++#include <string.h>
+ #include <errno.h>
+ #include <netdb.h>
+ #include <xmc.h>
diff --git a/x11/xmx/patches/patch-ac b/x11/xmx/patches/patch-ac
new file mode 100644
index 00000000000..8e628584613
--- /dev/null
+++ b/x11/xmx/patches/patch-ac
@@ -0,0 +1,12 @@
+$NetBSD: patch-ac,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- lib/Xmc/AddDis.c~ 1998-02-01 14:02:27.000000000 -0500
++++ lib/Xmc/AddDis.c 2008-08-31 00:17:18.000000000 -0400
+@@ -20,6 +20,7 @@
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
++#include <string.h>
+ #include <xmc.h>
+ #include <xmclib.h>
+ #include <xmcp.h>
diff --git a/x11/xmx/patches/patch-ad b/x11/xmx/patches/patch-ad
new file mode 100644
index 00000000000..b6485ab701a
--- /dev/null
+++ b/x11/xmx/patches/patch-ad
@@ -0,0 +1,13 @@
+$NetBSD: patch-ad,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- lib/Xmc/DispInfo.c~ 1998-03-03 13:24:19.000000000 -0500
++++ lib/Xmc/DispInfo.c 2008-08-31 00:17:51.000000000 -0400
+@@ -20,6 +20,8 @@
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
++#include <stdlib.h>
++#include <string.h>
+ #include <xmc.h>
+ #include <xmclib.h>
+ #include <xmcp.h>
diff --git a/x11/xmx/patches/patch-ae b/x11/xmx/patches/patch-ae
new file mode 100644
index 00000000000..2825d6497d1
--- /dev/null
+++ b/x11/xmx/patches/patch-ae
@@ -0,0 +1,12 @@
+$NetBSD: patch-ae,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- lib/Xmc/ErrHndlr.c~ 1998-02-01 14:03:30.000000000 -0500
++++ lib/Xmc/ErrHndlr.c 2008-08-31 00:18:23.000000000 -0400
+@@ -21,6 +21,7 @@
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <xmc.h>
+ #include <xmclib.h>
+ #include <xmcp.h>
diff --git a/x11/xmx/patches/patch-af b/x11/xmx/patches/patch-af
new file mode 100644
index 00000000000..505b0e90a00
--- /dev/null
+++ b/x11/xmx/patches/patch-af
@@ -0,0 +1,13 @@
+$NetBSD: patch-af,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- lib/Xmc/GetConf.c~ 1998-02-01 15:05:10.000000000 -0500
++++ lib/Xmc/GetConf.c 2008-08-31 00:18:49.000000000 -0400
+@@ -20,6 +20,8 @@
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
++#include <stdlib.h>
++#include <string.h>
+ #include <xmc.h>
+ #include <xmclib.h>
+ #include <xmcp.h>
diff --git a/x11/xmx/patches/patch-ag b/x11/xmx/patches/patch-ag
new file mode 100644
index 00000000000..06f1ab94196
--- /dev/null
+++ b/x11/xmx/patches/patch-ag
@@ -0,0 +1,13 @@
+$NetBSD: patch-ag,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- lib/Xmc/ListDis.c~ 1998-02-01 15:07:47.000000000 -0500
++++ lib/Xmc/ListDis.c 2008-08-31 00:19:09.000000000 -0400
+@@ -20,6 +20,8 @@
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
++#include <stdlib.h>
++#include <string.h>
+ #include <xmc.h>
+ #include <xmclib.h>
+ #include <xmcp.h>
diff --git a/x11/xmx/patches/patch-ah b/x11/xmx/patches/patch-ah
new file mode 100644
index 00000000000..b3deeee487b
--- /dev/null
+++ b/x11/xmx/patches/patch-ah
@@ -0,0 +1,14 @@
+$NetBSD: patch-ah,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- lib/Xmc/Open.c~ 1998-02-12 09:13:22.000000000 -0500
++++ lib/Xmc/Open.c 2008-08-31 00:19:40.000000000 -0400
+@@ -32,6 +32,9 @@
+ #ifdef SVR4
+ #include <sys/filio.h>
+ #endif
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #include <fcntl.h>
+ #include <netdb.h>
+ #include <xmc.h>
diff --git a/x11/xmx/patches/patch-ai b/x11/xmx/patches/patch-ai
new file mode 100644
index 00000000000..1e77e978408
--- /dev/null
+++ b/x11/xmx/patches/patch-ai
@@ -0,0 +1,13 @@
+$NetBSD: patch-ai,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- lib/Xmc/QueryDis.c~ 1998-02-01 15:14:55.000000000 -0500
++++ lib/Xmc/QueryDis.c 2008-08-31 00:20:04.000000000 -0400
+@@ -20,6 +20,8 @@
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
++#include <stdlib.h>
++#include <string.h>
+ #include <xmc.h>
+ #include <xmclib.h>
+ #include <xmcp.h>
diff --git a/x11/xmx/patches/patch-aj b/x11/xmx/patches/patch-aj
new file mode 100644
index 00000000000..4ed0997e35d
--- /dev/null
+++ b/x11/xmx/patches/patch-aj
@@ -0,0 +1,12 @@
+$NetBSD: patch-aj,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- lib/Xmc/Register.c~ 1998-02-01 14:04:48.000000000 -0500
++++ lib/Xmc/Register.c 2008-08-31 00:20:32.000000000 -0400
+@@ -20,6 +20,7 @@
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
++#include <string.h>
+ #include <xmc.h>
+ #include <xmclib.h>
+ #include <xmcp.h>
diff --git a/x11/xmx/patches/patch-ak b/x11/xmx/patches/patch-ak
new file mode 100644
index 00000000000..436736f65f7
--- /dev/null
+++ b/x11/xmx/patches/patch-ak
@@ -0,0 +1,12 @@
+$NetBSD: patch-ak,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- lib/Xmc/SetAuth.c~ 1998-02-01 14:04:53.000000000 -0500
++++ lib/Xmc/SetAuth.c 2008-08-31 00:20:55.000000000 -0400
+@@ -20,6 +20,7 @@
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
++#include <string.h>
+ #include <xmc.h>
+ #include <xmclib.h>
+ #include <xmcp.h>
diff --git a/x11/xmx/patches/patch-al b/x11/xmx/patches/patch-al
new file mode 100644
index 00000000000..94aaf52532a
--- /dev/null
+++ b/x11/xmx/patches/patch-al
@@ -0,0 +1,12 @@
+$NetBSD: patch-al,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- lib/Xmc/SetConf.c~ 1998-02-01 14:05:08.000000000 -0500
++++ lib/Xmc/SetConf.c 2008-08-31 00:21:28.000000000 -0400
+@@ -20,6 +20,7 @@
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
++#include <string.h>
+ #include <xmc.h>
+ #include <xmclib.h>
+ #include <xmcp.h>
diff --git a/x11/xmx/patches/patch-am b/x11/xmx/patches/patch-am
new file mode 100644
index 00000000000..defabc7d27c
--- /dev/null
+++ b/x11/xmx/patches/patch-am
@@ -0,0 +1,12 @@
+$NetBSD: patch-am,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- lib/Xmc/SetDispTag.c~ 1998-02-01 14:05:12.000000000 -0500
++++ lib/Xmc/SetDispTag.c 2008-08-31 00:21:47.000000000 -0400
+@@ -20,6 +20,7 @@
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
++#include <string.h>
+ #include <xmc.h>
+ #include <xmclib.h>
+ #include <xmcp.h>
diff --git a/x11/xmx/patches/patch-ba b/x11/xmx/patches/patch-ba
new file mode 100644
index 00000000000..135673478cc
--- /dev/null
+++ b/x11/xmx/patches/patch-ba
@@ -0,0 +1,15 @@
+$NetBSD: patch-ba,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/args.c~ 1998-03-27 10:11:58.000000000 -0500
++++ server/args.c 2008-08-31 00:25:23.000000000 -0400
+@@ -686,6 +686,9 @@ tok
+ buf[i++] = (char)ch;
+ break;
+ }
+- return (char *)err(0, "tok: token too long\n");
++ /* this err() returns its first arg */
++ /*return (char *)err(0, "tok: token too long\n");*/
++ err(0, "tok: token too long\n");
++ return NULL;
+ }
+ #undef MAXTOKLEN
diff --git a/x11/xmx/patches/patch-bb b/x11/xmx/patches/patch-bb
new file mode 100644
index 00000000000..4e3163f17c2
--- /dev/null
+++ b/x11/xmx/patches/patch-bb
@@ -0,0 +1,12 @@
+$NetBSD: patch-bb,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/atom.c~ 1997-11-07 09:55:37.000000000 -0500
++++ server/atom.c 2008-08-31 00:25:58.000000000 -0400
+@@ -28,6 +28,7 @@
+ * *
+ ************************************************************************/
+ #include <stdlib.h>
++#include <string.h>
+ #define NEED_REPLIES
+ #include <X11/Xproto.h>
+ #include <X11/X.h>
diff --git a/x11/xmx/patches/patch-bc b/x11/xmx/patches/patch-bc
new file mode 100644
index 00000000000..26a2c5894b6
--- /dev/null
+++ b/x11/xmx/patches/patch-bc
@@ -0,0 +1,12 @@
+$NetBSD: patch-bc,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/auth.c~ 1997-10-27 16:25:10.000000000 -0500
++++ server/auth.c 2008-08-31 00:26:26.000000000 -0400
+@@ -30,6 +30,7 @@
+ #include <stdio.h>
+ #include <sys/param.h>
+ #include <stdlib.h>
++#include <string.h>
+ #include <unistd.h>
+ #include <errno.h>
+
diff --git a/x11/xmx/patches/patch-bd b/x11/xmx/patches/patch-bd
new file mode 100644
index 00000000000..50ef8357cdb
--- /dev/null
+++ b/x11/xmx/patches/patch-bd
@@ -0,0 +1,28 @@
+$NetBSD: patch-bd,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/buf.c.orig 1998-04-09 17:44:21.000000000 -0400
++++ server/buf.c 2008-08-31 01:18:26.000000000 -0400
+@@ -27,6 +27,8 @@
+ * Manage buffers. *
+ * *
+ ************************************************************************/
++#include <stdlib.h>
++#include <string.h>
+ #include <errno.h>
+
+ #include "xmx.h"
+@@ -65,8 +67,12 @@ buf_new
+ chp = bp->head;
+ }
+ else {
+- if (MALLOC(bp, buffer_t *, sizeof(buffer_t)))
+- return (buffer_t *)err(0, "malloc returned zero");
++ if (MALLOC(bp, buffer_t *, sizeof(buffer_t))) {
++ /* this err returns its first arg */
++ /*return (buffer_t *)err(0, "malloc returned zero");*/
++ err(0, "malloc returned zero");
++ return NULL;
++ }
+ if ((chp = new_chunk()) == 0) {
+ free(bp);
+ return 0;
diff --git a/x11/xmx/patches/patch-be b/x11/xmx/patches/patch-be
new file mode 100644
index 00000000000..faa25d8cd66
--- /dev/null
+++ b/x11/xmx/patches/patch-be
@@ -0,0 +1,12 @@
+$NetBSD: patch-be,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/cblock.c~ 1998-03-18 14:37:05.000000000 -0500
++++ server/cblock.c 2008-08-31 00:29:03.000000000 -0400
+@@ -29,6 +29,7 @@
+ * *
+ ************************************************************************/
+ #include <stdlib.h>
++#include <string.h>
+ #include <X11/Xproto.h>
+ #include "xmx.h"
+ #include "incl/cblock.pvt.h"
diff --git a/x11/xmx/patches/patch-bf b/x11/xmx/patches/patch-bf
new file mode 100644
index 00000000000..2457c1ee794
--- /dev/null
+++ b/x11/xmx/patches/patch-bf
@@ -0,0 +1,14 @@
+$NetBSD: patch-bf,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/client.c~ 1997-10-21 15:53:24.000000000 -0400
++++ server/client.c 2008-08-31 00:29:25.000000000 -0400
+@@ -32,7 +32,9 @@
+ #ifdef _AIX
+ #include <sys/select.h>
+ #endif
++#include <stdio.h>
+ #include <stdlib.h>
++#include <string.h>
+ #include <X11/X.h>
+ #include "xmx.h"
+ #include "res.h"
diff --git a/x11/xmx/patches/patch-bg b/x11/xmx/patches/patch-bg
new file mode 100644
index 00000000000..e5b8173ad22
--- /dev/null
+++ b/x11/xmx/patches/patch-bg
@@ -0,0 +1,12 @@
+$NetBSD: patch-bg,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/cliz.c~ 1998-04-29 17:24:15.000000000 -0400
++++ server/cliz.c 2008-08-31 00:29:55.000000000 -0400
+@@ -37,6 +37,7 @@
+ #include <netinet/in_systm.h> /* ...and this */
+ #include <netinet/ip.h> /* for IP_MAXPACKET */
+ #include <stdlib.h>
++#include <string.h>
+ #include <X11/X.h>
+ #include <X11/Xatom.h>
+ #define NEED_REPLIES
diff --git a/x11/xmx/patches/patch-bh b/x11/xmx/patches/patch-bh
new file mode 100644
index 00000000000..c478bb1f6f2
--- /dev/null
+++ b/x11/xmx/patches/patch-bh
@@ -0,0 +1,21 @@
+$NetBSD: patch-bh,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/cmapwin.c.orig 1998-04-30 10:33:41.000000000 -0400
++++ server/cmapwin.c 2008-08-31 01:08:28.000000000 -0400
+@@ -28,11 +28,16 @@
+ * value of the WM_COLORMAP_WINDOWS property. *
+ * *
+ ************************************************************************/
++#include <stdlib.h>
++#include <string.h>
+ #include "xmx.h"
+ #include "incl/cmapwin.pvt.h"
+
+ #define WINVECINCR 32
+
++/* avoid conflict with legacy version of strchr */
++#define index myindex
++
+ static rid_t *winvec;
+ static int winvecsz;
+ static int index;
diff --git a/x11/xmx/patches/patch-bi b/x11/xmx/patches/patch-bi
new file mode 100644
index 00000000000..f8336dd0cd1
--- /dev/null
+++ b/x11/xmx/patches/patch-bi
@@ -0,0 +1,37 @@
+$NetBSD: patch-bi,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/xmx.h~ 1998-05-05 14:54:52.000000000 -0400
++++ server/xmx.h 2008-08-31 00:38:36.000000000 -0400
+@@ -25,6 +25,9 @@
+ * xmx.h *
+ * *
+ ************************************************************************/
++
++#include <stdint.h>
++
+ /*
+ ** Rationalize Predefines
+ */
+@@ -665,15 +668,15 @@
+ ************************************************************************/
+ typedef unsigned long ulong_t; /* an unsigned long */
+ typedef unsigned int uint_t; /* an unsigned word */
+-typedef unsigned long u32_t; /* a 32 bit unsigned int */
+-typedef unsigned short u16_t; /* a 16 bit unsigned int */
+-typedef unsigned char u8_t; /* an 8 bit unsigned int */
++typedef uint32_t u32_t; /* a 32 bit unsigned int */
++typedef uint16_t u16_t; /* a 16 bit unsigned int */
++typedef uint8_t u8_t; /* an 8 bit unsigned int */
+
+-typedef int slong_t; /* signed long */
++typedef long slong_t; /* signed long */
+ typedef int sint_t; /* signed word */
+-typedef long s32_t; /* a 32 bit signed int */
+-typedef short s16_t; /* a 16 bit signed int */
+-typedef char s8_t; /* an 8 bit signed int */
++typedef int32_t s32_t; /* a 32 bit signed int */
++typedef int16_t s16_t; /* a 16 bit signed int */
++typedef int8_t s8_t; /* an 8 bit signed int */
+
+ typedef u8_t kcode_t;
+
diff --git a/x11/xmx/patches/patch-bj b/x11/xmx/patches/patch-bj
new file mode 100644
index 00000000000..5347fb9e199
--- /dev/null
+++ b/x11/xmx/patches/patch-bj
@@ -0,0 +1,21 @@
+$NetBSD: patch-bj,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/color.c.orig 1998-05-05 15:01:35.000000000 -0400
++++ server/color.c 2008-08-31 01:25:45.000000000 -0400
+@@ -31,6 +31,7 @@
+ #include <sys/select.h>
+ #endif
+ #include <stdlib.h>
++#include <string.h>
+ #define NEED_REPLIES
+ #define NEED_EVENTS
+ #include <X11/Xproto.h>
+@@ -807,7 +808,7 @@ alloc_cells_reply
+ npixels = ((xAllocColorCellsReply *)rp)->nPixels;
+ nmasks = ((xAllocColorCellsReply *)rp)->nMasks;
+ real_pixels = (pixel_t *)((xAllocColorCellsReply *)rp + 1);
+- maskp = (mask_t *)(real_pixels[npixels]);
++ maskp = (mask_t *)&(real_pixels[npixels]);
+ real_mask = 0;
+ for (i=0; i<nmasks; i++)
+ real_mask |= maskp[i];
diff --git a/x11/xmx/patches/patch-bk b/x11/xmx/patches/patch-bk
new file mode 100644
index 00000000000..edd38b7a913
--- /dev/null
+++ b/x11/xmx/patches/patch-bk
@@ -0,0 +1,12 @@
+$NetBSD: patch-bk,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/connect.c~ 1998-04-01 18:41:25.000000000 -0500
++++ server/connect.c 2008-08-31 00:39:48.000000000 -0400
+@@ -33,6 +33,7 @@
+ #include <sys/select.h>
+ #endif
+ #include <stdlib.h>
++#include <string.h>
+ #include <errno.h>
+ #define NEED_REPLIES
+ #define NEED_EVENTS
diff --git a/x11/xmx/patches/patch-bl b/x11/xmx/patches/patch-bl
new file mode 100644
index 00000000000..057faa8847c
--- /dev/null
+++ b/x11/xmx/patches/patch-bl
@@ -0,0 +1,13 @@
+$NetBSD: patch-bl,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/cookie.c~ 1997-09-01 10:43:11.000000000 -0400
++++ server/cookie.c 2008-08-31 00:40:13.000000000 -0400
+@@ -25,6 +25,8 @@
+ * cookie.c *
+ * *
+ ************************************************************************/
++#include <stdlib.h>
++#include <string.h>
+ #include "xmx.h"
+ #include "incl/cookie.pvt.h"
+
diff --git a/x11/xmx/patches/patch-bm b/x11/xmx/patches/patch-bm
new file mode 100644
index 00000000000..18946cd958d
--- /dev/null
+++ b/x11/xmx/patches/patch-bm
@@ -0,0 +1,12 @@
+$NetBSD: patch-bm,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/cursor.c~ 1998-02-26 18:31:52.000000000 -0500
++++ server/cursor.c 2008-08-31 00:40:42.000000000 -0400
+@@ -25,6 +25,7 @@
+ * cursor.c *
+ * *
+ ************************************************************************/
++#include <stdlib.h>
+ #include <X11/Xproto.h>
+ #include <X11/X.h>
+ #include "xmx.h"
diff --git a/x11/xmx/patches/patch-bn b/x11/xmx/patches/patch-bn
new file mode 100644
index 00000000000..a325c04a535
--- /dev/null
+++ b/x11/xmx/patches/patch-bn
@@ -0,0 +1,27 @@
+$NetBSD: patch-bn,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/cx.c.orig 1997-10-03 16:45:33.000000000 -0400
++++ server/cx.c 2008-08-31 01:27:59.000000000 -0400
+@@ -30,6 +30,7 @@
+ * server i/o dialog. *
+ * *
+ ************************************************************************/
++#include <stdlib.h>
+ #include "xmx.h"
+ #include "df.h"
+ #include "cx.h"
+@@ -113,8 +114,12 @@ new_cx
+ cxp = cxfree;
+ cxfree = cxfree->next;
+ }
+- else if (MALLOC(cxp, cx_t *, sizeof(cx_t)))
+- return (cx_t *)err(0, "malloc returned zero");
++ else if (MALLOC(cxp, cx_t *, sizeof(cx_t))) {
++ /* this err returns its first argument */
++ /*return (cx_t *)err(0, "malloc returned zero");*/
++ err(0, "malloc returned zero");
++ return NULL;
++ }
+
+ return cxp;
+ }
diff --git a/x11/xmx/patches/patch-bo b/x11/xmx/patches/patch-bo
new file mode 100644
index 00000000000..a186cb3b06b
--- /dev/null
+++ b/x11/xmx/patches/patch-bo
@@ -0,0 +1,66 @@
+$NetBSD: patch-bo,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/debug.c~ 1998-01-20 10:56:51.000000000 -0500
++++ server/debug.c 2008-08-31 00:42:03.000000000 -0400
+@@ -27,6 +27,7 @@
+ * Some routines for debugging. *
+ * *
+ ************************************************************************/
++#include <stdio.h>
+ #include <stdlib.h>
+
+ #include "xmx.h"
+@@ -317,7 +318,7 @@ debug_conn_type_str
+ case XMC: return "XMC";
+ case XDMCP: return "XDMCP";
+ default:
+- sprintf(buf, "<%d>", type);
++ snprintf(buf, sizeof(buf), "<%d>", type);
+ return buf;
+ }
+ }
+@@ -340,7 +341,7 @@ debug_vcstate_str
+ case VC_INFLUX: return "VC_INFLUX";
+ case VC_FIXED: return "VC_FIXED";
+ default:
+- sprintf(buf, "<%d>", state);
++ snprintf(buf, sizeof(buf), "<%d>", state);
+ return buf;
+ }
+ }
+@@ -369,7 +370,7 @@ debug_server_state_str
+ case S_KETCHUP: return "S_KETCHUP";
+ case S_READY: return "S_READY";
+ default:
+- sprintf(buf, "<%d>", state);
++ snprintf(buf, sizeof(buf), "<%d>", state);
+ return buf;
+ }
+ }
+@@ -391,7 +392,7 @@ debug_buf_type_str
+ case B_STATIC: return "B_STATIC";
+ case B_FREEONWRITE: return "B_FREEONWRITE";
+ default:
+- sprintf(buf, "<%d>", type);
++ snprintf(buf, sizeof(buf), "<%d>", type);
+ return buf;
+ }
+ }
+@@ -415,7 +416,7 @@ debug_queue_dest_str
+ case Q_XCLIENT: return "Q_XCLIENT";
+ case Q_XMCCLIENT: return "Q_XMCCLIENT";
+ default:
+- sprintf(buf, "<%d>", dest);
++ snprintf(buf, sizeof(buf), "<%d>", dest);
+ return buf;
+ }
+ }
+@@ -442,7 +443,7 @@ debug_proto_type_str
+ case P_IMAGE: return "P_IMAGE";
+ case P_EXT: return "P_EXT";
+ default:
+- sprintf(buf, "<%d>", type);
++ snprintf(buf, sizeof(buf), "<%d>", type);
+ return buf;
+ }
+ }
diff --git a/x11/xmx/patches/patch-bp b/x11/xmx/patches/patch-bp
new file mode 100644
index 00000000000..91454d8e689
--- /dev/null
+++ b/x11/xmx/patches/patch-bp
@@ -0,0 +1,12 @@
+$NetBSD: patch-bp,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/df.c~ 1997-10-03 16:48:11.000000000 -0400
++++ server/df.c 2008-08-31 00:42:29.000000000 -0400
+@@ -32,6 +32,7 @@
+ * It just makes it easier to write those dialogs. *
+ * *
+ ************************************************************************/
++#include <stdlib.h>
+ #include "xmx.h"
+ #include "df.h"
+ #include "incl/df.pvt.h"
diff --git a/x11/xmx/patches/patch-bq b/x11/xmx/patches/patch-bq
new file mode 100644
index 00000000000..44f95f3aa5a
--- /dev/null
+++ b/x11/xmx/patches/patch-bq
@@ -0,0 +1,77 @@
+$NetBSD: patch-bq,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/dprx.c~ 1998-04-03 17:45:53.000000000 -0500
++++ server/dprx.c 2008-08-31 00:43:57.000000000 -0400
+@@ -27,7 +27,9 @@
+ * Routines for printing X protocol structures. *
+ * *
+ ************************************************************************/
++#include <stdio.h>
+ #include <stdlib.h>
++#include <string.h>
+ #define NEED_REPLIES
+ #define NEED_EVENTS
+ #include <X11/Xproto.h>
+@@ -60,7 +62,7 @@ dprx_stackmode_str
+ case BottomIf: return "BottomIf";
+ case Opposite: return "Opposite";
+ default:
+- sprintf(buf, "<%d>", mode);
++ snprintf(buf, sizeof(buf), "<%d>", mode);
+ return buf;
+ }
+ }
+@@ -83,7 +85,7 @@ dprx_notify_detail_str
+ case NotifyPointerRoot: return "NotifyPointerRoot";
+ case NotifyDetailNone: return "NotifyDetailNone";
+ default:
+- sprintf(buf, "<%d>", detail);
++ snprintf(buf, sizeof(buf), "<%d>", detail);
+ return buf;
+ }
+ }
+@@ -265,7 +267,7 @@ dprx_notify_mode_str
+ case NotifyUngrab: return "NotifyUngrab";
+ case NotifyWhileGrabbed: return "NotifyWhileGrabbed";
+ default:
+- sprintf(buf, "<unknown mode(%d)>", mode);
++ snprintf(buf, sizeof(buf), "<unknown mode(%d)>", mode);
+ return buf;
+ }
+ }
+@@ -293,7 +295,7 @@ dprx_allowevents_mode_str
+ case AsyncBoth: return "AsyncBoth";
+ case SyncBoth: return "SyncBoth";
+ default:
+- sprintf(buf, "<unknown mode(%d)>", mode);
++ snprintf(buf, sizeof(buf), "<unknown mode(%d)>", mode);
+ return buf;
+ }
+ }
+@@ -318,7 +320,7 @@ dprx_addrfam_str
+ case FamilyLocal: return "FamilyLocal";
+ case FamilyWild: return "FamilyWild";
+ default:
+- sprintf(buf, "FamilyBAD(%d)", family);
++ snprintf(buf, sizeof(buf), "FamilyBAD(%d)", family);
+ return buf;
+ }
+ }
+@@ -558,7 +560,7 @@ dprx_pixel_str
+ {
+ static char buf[32];
+
+- sprintf(buf, "%d (%x)", pxl, pxl);
++ snprintf(buf, sizeof(buf), "%d (%x)", pxl, pxl);
+
+ return buf;
+ }
+@@ -2213,7 +2215,7 @@ dprx_event
+ warn("\teventX_________ %d\n", ep->u.keyButtonPointer.eventX);
+ warn("\teventY_________ %d\n", ep->u.keyButtonPointer.eventY);
+ if (isprint(ep->u.u.detail))
+- sprintf(buf, " '%c'", ep->u.u.detail);
++ snprintf(buf, sizeof(buf), " '%c'", ep->u.u.detail);
+ else
+ buf[0] = '\0';
+ warn("\tdetail_________ %d%s\n", ep->u.u.detail, buf);
diff --git a/x11/xmx/patches/patch-br b/x11/xmx/patches/patch-br
new file mode 100644
index 00000000000..23664d74a78
--- /dev/null
+++ b/x11/xmx/patches/patch-br
@@ -0,0 +1,12 @@
+$NetBSD: patch-br,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/ebuf.c~ 1998-05-07 13:52:14.000000000 -0400
++++ server/ebuf.c 2008-08-31 00:44:38.000000000 -0400
+@@ -28,6 +28,7 @@
+ * Store keyboard or pointer events and play them back. *
+ * *
+ ************************************************************************/
++#include <stdlib.h>
+ #include <X11/X.h>
+ #define NEED_EVENTS
+ #include <X11/Xproto.h>
diff --git a/x11/xmx/patches/patch-bs b/x11/xmx/patches/patch-bs
new file mode 100644
index 00000000000..4b56883718c
--- /dev/null
+++ b/x11/xmx/patches/patch-bs
@@ -0,0 +1,60 @@
+$NetBSD: patch-bs,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/error.c.orig 1997-08-22 14:37:47.000000000 -0400
++++ server/error.c 2008-08-31 01:28:34.000000000 -0400
+@@ -26,6 +26,8 @@
+ * *
+ ************************************************************************/
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #include <errno.h>
+
+ #include "xmx.h"
+@@ -37,8 +39,10 @@
+ #include <varargs.h>
+ #endif
+
++#if 0
+ extern int sys_nerr;
+ extern char *sys_errlist[];
++#endif
+
+ extern uint_t debug;
+
+@@ -71,10 +75,7 @@ pwarn
+ VA1(pvar, char *,fstr);
+
+ if (debug) {
+- if (errno < 0 || errno > sys_nerr)
+- msg = "unknown error";
+- else
+- msg = sys_errlist[errno];
++ msg = strerror(errno);
+ vfprintf(stderr, fstr, pvar);
+ fprintf(stderr, ": %s\n", msg);
+ }
+@@ -131,10 +132,7 @@ pquit
+ VA2(pvar, int,code, char *,fstr);
+
+ if (debug) {
+- if (errno < 0 || errno > sys_nerr)
+- msg = "unknown error";
+- else
+- msg = sys_errlist[errno];
++ msg = strerror(errno);
+ vfprintf(stderr, fstr, pvar);
+ fprintf(stderr, ": %s\n", msg);
+ }
+@@ -160,10 +158,7 @@ perr
+ VA2(pvar, int,code, char *,fstr);
+
+ if (debug) {
+- if (errno < 0 || errno > sys_nerr)
+- msg = "unknown error";
+- else
+- msg = sys_errlist[errno];
++ msg = strerror(errno);
+ vfprintf(stderr, fstr, pvar);
+ fprintf(stderr, ": %s\n", msg);
+ }
diff --git a/x11/xmx/patches/patch-bt b/x11/xmx/patches/patch-bt
new file mode 100644
index 00000000000..7991fc5b575
--- /dev/null
+++ b/x11/xmx/patches/patch-bt
@@ -0,0 +1,12 @@
+$NetBSD: patch-bt,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/am.c~ 1998-04-28 17:35:06.000000000 -0400
++++ server/am.c 2008-08-31 01:07:31.000000000 -0400
+@@ -33,6 +33,7 @@
+ ************************************************************************/
+ #define AM_C
+
++#include <stdlib.h>
+ #include "xmx.h"
+ #include "am.h"
+ #include "incl/am.pvt.h"
diff --git a/x11/xmx/patches/patch-bu b/x11/xmx/patches/patch-bu
new file mode 100644
index 00000000000..13ae02297b6
--- /dev/null
+++ b/x11/xmx/patches/patch-bu
@@ -0,0 +1,20 @@
+$NetBSD: patch-bu,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/es.c~ 1997-08-26 17:21:49.000000000 -0400
++++ server/es.c 2008-08-31 01:29:20.000000000 -0400
+@@ -38,13 +38,13 @@ es_mark
+ DB buffer_t *bp
+ DE
+ {
+- register int i;
++ register intptr_t i;
+ register chunk_t *chp;
+
+ chp = buf_chunk(bp);
+
+ if (chp->type == P_EVENT) { /* can be called repeatedly on same chunk */
+- i = (int)chp->dptr;
++ i = (intptr_t)chp->dptr;
+ chp->dptr = (void *)(i + 1);
+ }
+ else if (chp->type == P_NONE) {
diff --git a/x11/xmx/patches/patch-bv b/x11/xmx/patches/patch-bv
new file mode 100644
index 00000000000..232479d7d8c
--- /dev/null
+++ b/x11/xmx/patches/patch-bv
@@ -0,0 +1,12 @@
+$NetBSD: patch-bv,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/expos.c~ 1998-03-17 11:45:01.000000000 -0500
++++ server/expos.c 2008-08-31 01:30:01.000000000 -0400
+@@ -29,6 +29,7 @@
+ * *
+ ************************************************************************/
+ #define NEED_EVENTS
++#include <stdlib.h>
+ #include <X11/Xproto.h>
+ #include <X11/X.h>
+
diff --git a/x11/xmx/patches/patch-bw b/x11/xmx/patches/patch-bw
new file mode 100644
index 00000000000..13207712442
--- /dev/null
+++ b/x11/xmx/patches/patch-bw
@@ -0,0 +1,13 @@
+$NetBSD: patch-bw,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/font.c~ 1998-02-25 16:59:05.000000000 -0500
++++ server/font.c 2008-08-31 01:30:38.000000000 -0400
+@@ -26,6 +26,8 @@
+ * *
+ ************************************************************************/
+ #define NEED_REPLIES
++#include <stdlib.h>
++#include <string.h>
+ #include <X11/Xproto.h>
+ #include <X11/X.h>
+ #include "xmx.h"
diff --git a/x11/xmx/patches/patch-bx b/x11/xmx/patches/patch-bx
new file mode 100644
index 00000000000..2542cc20b09
--- /dev/null
+++ b/x11/xmx/patches/patch-bx
@@ -0,0 +1,14 @@
+$NetBSD: patch-bx,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/zb.h~ 1997-09-29 15:54:22.000000000 -0400
++++ server/zb.h 2008-08-31 01:32:42.000000000 -0400
+@@ -65,5 +65,8 @@ extern zb_t zb;
+ **
+ ** Note, cast here works around absence of buf.pub.h include in
+ ** files that use this macro and no other buf routines.
++**
++** which DOESN'T WORK, silly... copying decl of buf_split instead.
+ */
+-#define zb_split() (chunk_t *)buf_split(zb.bp, 0)
++extern FUNC( chunk_t *, buf_split, (buffer_t *, uint_t));
++#define zb_split() buf_split(zb.bp, 0)
diff --git a/x11/xmx/patches/patch-by b/x11/xmx/patches/patch-by
new file mode 100644
index 00000000000..df001d3bc82
--- /dev/null
+++ b/x11/xmx/patches/patch-by
@@ -0,0 +1,32 @@
+$NetBSD: patch-by,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/hash.c~ 1997-12-15 12:12:11.000000000 -0500
++++ server/hash.c 2008-08-31 01:33:36.000000000 -0400
+@@ -36,6 +36,9 @@
+ * All tables are actually two tables, a map and an inverse map. *
+ * *
+ ************************************************************************/
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #include "xmx.h"
+ #include "df.h"
+
+@@ -565,7 +568,7 @@ hash_print
+ warn("\t[%04d]", i);
+ for (ep=tab->map[i]; ep; ep=ep->next) {
+ if (ep->data)
+- sprintf(dbuf, ",0x%x", ep->data);
++ snprintf(dbuf, sizeof(dbuf), ",0x%x", ep->data);
+ else
+ strcpy(dbuf, "");
+ warn(" {%x,%x%s%s}", ep->key, ep->val, ep->mark ? ",MARK":"", dbuf);
+@@ -579,7 +582,7 @@ hash_print
+ warn("\t[%04d]", i);
+ for (ep=tab->unmap[i]; ep; ep=ep->next) {
+ if (ep->data)
+- sprintf(dbuf, ",0x%x", ep->data);
++ snprintf(dbuf, sizeof(dbuf), ",0x%x", ep->data);
+ else
+ strcpy(dbuf, "");
+ warn(" {%x,%x%s%s}", ep->key, ep->val, ep->mark ? ",MARK":"", dbuf);
diff --git a/x11/xmx/patches/patch-bz b/x11/xmx/patches/patch-bz
new file mode 100644
index 00000000000..bdd69bfd659
--- /dev/null
+++ b/x11/xmx/patches/patch-bz
@@ -0,0 +1,13 @@
+$NetBSD: patch-bz,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/host.c~ 1996-04-07 22:00:25.000000000 -0400
++++ server/host.c 2008-08-31 01:34:06.000000000 -0400
+@@ -30,6 +30,8 @@
+ #include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
++#include <stdlib.h>
++#include <string.h>
+ #include <netdb.h>
+
+ #include "xmx.h"
diff --git a/x11/xmx/patches/patch-ca b/x11/xmx/patches/patch-ca
new file mode 100644
index 00000000000..531f29c9d65
--- /dev/null
+++ b/x11/xmx/patches/patch-ca
@@ -0,0 +1,12 @@
+$NetBSD: patch-ca,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/image.c~ 1998-05-07 16:30:37.000000000 -0400
++++ server/image.c 2008-08-31 01:34:39.000000000 -0400
+@@ -52,6 +52,7 @@
+ ************************************************************************/
+ #define NEED_REPLIES
+ #define NEED_EVENTS
++#include <stdlib.h>
+ #include <X11/X.h>
+ #include <X11/Xproto.h>
+ #include "xmx.h"
diff --git a/x11/xmx/patches/patch-cb b/x11/xmx/patches/patch-cb
new file mode 100644
index 00000000000..1f63e9a5aaa
--- /dev/null
+++ b/x11/xmx/patches/patch-cb
@@ -0,0 +1,12 @@
+$NetBSD: patch-cb,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/imask.c~ 1996-04-03 11:41:23.000000000 -0500
++++ server/imask.c 2008-08-31 01:35:04.000000000 -0400
+@@ -27,6 +27,7 @@
+ * Input masks. *
+ * *
+ ************************************************************************/
++#include <stdlib.h>
+ #include "xmx.h"
+ #include "incl/imask.pvt.h"
+
diff --git a/x11/xmx/patches/patch-cc b/x11/xmx/patches/patch-cc
new file mode 100644
index 00000000000..3a576127550
--- /dev/null
+++ b/x11/xmx/patches/patch-cc
@@ -0,0 +1,13 @@
+$NetBSD: patch-cc,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/inp.c~ 1998-05-04 15:09:44.000000000 -0400
++++ server/inp.c 2008-08-31 01:35:30.000000000 -0400
+@@ -45,6 +45,8 @@
+ ************************************************************************/
+ #define NEED_REPLIES
+ #define NEED_EVENTS
++#include <stdlib.h>
++#include <string.h>
+ #include <X11/Xproto.h>
+ #include <X11/X.h>
+ #include <xmc.h>
diff --git a/x11/xmx/patches/patch-cd b/x11/xmx/patches/patch-cd
new file mode 100644
index 00000000000..f23aa23b2fd
--- /dev/null
+++ b/x11/xmx/patches/patch-cd
@@ -0,0 +1,12 @@
+$NetBSD: patch-cd,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/iswap.c~ 1998-04-27 16:17:54.000000000 -0400
++++ server/iswap.c 2008-08-31 01:35:53.000000000 -0400
+@@ -31,6 +31,7 @@
+ * locations outside the buffers. *
+ * *
+ ************************************************************************/
++#include <string.h>
+ #include "iswap.h"
+ #include "xmx.h"
+ #include "incl/iswap.pvt.h"
diff --git a/x11/xmx/patches/patch-ce b/x11/xmx/patches/patch-ce
new file mode 100644
index 00000000000..494e577169f
--- /dev/null
+++ b/x11/xmx/patches/patch-ce
@@ -0,0 +1,13 @@
+$NetBSD: patch-ce,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/kpm.c~ 1998-04-30 17:47:54.000000000 -0400
++++ server/kpm.c 2008-08-31 01:36:13.000000000 -0400
+@@ -27,6 +27,8 @@
+ * Implement keyboard/pointer mapping. *
+ * *
+ ************************************************************************/
++#include <stdlib.h>
++#include <string.h>
+ #include <X11/X.h>
+ #define NEED_EVENTS
+ #define NEED_REPLIES
diff --git a/x11/xmx/patches/patch-cf b/x11/xmx/patches/patch-cf
new file mode 100644
index 00000000000..80c2f172fa9
--- /dev/null
+++ b/x11/xmx/patches/patch-cf
@@ -0,0 +1,12 @@
+$NetBSD: patch-cf,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/list.c~ 1997-08-27 01:21:18.000000000 -0400
++++ server/list.c 2008-08-31 01:36:41.000000000 -0400
+@@ -27,6 +27,7 @@
+ * Efficient variable length lists. *
+ * *
+ ************************************************************************/
++#include <stdlib.h>
+ #include "xmx.h"
+ #include "incl/list.pvt.h"
+
diff --git a/x11/xmx/patches/patch-cg b/x11/xmx/patches/patch-cg
new file mode 100644
index 00000000000..933916c2132
--- /dev/null
+++ b/x11/xmx/patches/patch-cg
@@ -0,0 +1,13 @@
+$NetBSD: patch-cg,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/main.c~ 1998-04-23 16:47:51.000000000 -0400
++++ server/main.c 2008-08-31 01:37:16.000000000 -0400
+@@ -28,6 +28,8 @@
+ * *
+ ************************************************************************/
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #include <sys/time.h>
+ #include <sys/types.h>
+ #include <sys/resource.h>
diff --git a/x11/xmx/patches/patch-ch b/x11/xmx/patches/patch-ch
new file mode 100644
index 00000000000..607e2055453
--- /dev/null
+++ b/x11/xmx/patches/patch-ch
@@ -0,0 +1,13 @@
+$NetBSD: patch-ch,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/mitauth.c~ 1996-04-03 11:41:24.000000000 -0500
++++ server/mitauth.c 2008-08-31 01:37:39.000000000 -0400
+@@ -27,6 +27,8 @@
+ * Do that wacky mit magic cookie thing. *
+ * *
+ ************************************************************************/
++#include <stdlib.h>
++#include <string.h>
+ #include "xmx.h"
+ #include "incl/mitauth.pvt.h"
+
diff --git a/x11/xmx/patches/patch-ci b/x11/xmx/patches/patch-ci
new file mode 100644
index 00000000000..9d9e37505a6
--- /dev/null
+++ b/x11/xmx/patches/patch-ci
@@ -0,0 +1,13 @@
+$NetBSD: patch-ci,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/pixmap.c~ 1998-04-27 11:32:07.000000000 -0400
++++ server/pixmap.c 2008-08-31 01:38:08.000000000 -0400
+@@ -25,6 +25,8 @@
+ * pixmap.c *
+ * *
+ ************************************************************************/
++#include <stdlib.h>
++#include <string.h>
+ #define NEED_REPLIES
+ #define NEED_EVENTS
+ #include <X11/Xproto.h>
diff --git a/x11/xmx/patches/patch-cj b/x11/xmx/patches/patch-cj
new file mode 100644
index 00000000000..c5d2814e74e
--- /dev/null
+++ b/x11/xmx/patches/patch-cj
@@ -0,0 +1,12 @@
+$NetBSD: patch-cj,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/plist.c~ 1996-04-03 11:41:24.000000000 -0500
++++ server/plist.c 2008-08-31 01:38:27.000000000 -0400
+@@ -27,6 +27,7 @@
+ * Generic pointer list type. *
+ * *
+ ************************************************************************/
++#include <stdlib.h>
+ #include "xmx.h"
+ #include "incl/plist.pvt.h"
+
diff --git a/x11/xmx/patches/patch-ck b/x11/xmx/patches/patch-ck
new file mode 100644
index 00000000000..a8497d80d5a
--- /dev/null
+++ b/x11/xmx/patches/patch-ck
@@ -0,0 +1,12 @@
+$NetBSD: patch-ck,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/pmap.c~ 1998-04-08 12:24:43.000000000 -0400
++++ server/pmap.c 2008-08-31 01:38:42.000000000 -0400
+@@ -25,6 +25,7 @@
+ * pmap.c *
+ * *
+ ************************************************************************/
++#include <stdlib.h>
+ #define NEED_REPLIES
+ #define NEED_EVENTS
+ #include <X11/X.h>
diff --git a/x11/xmx/patches/patch-cl b/x11/xmx/patches/patch-cl
new file mode 100644
index 00000000000..490f034c921
--- /dev/null
+++ b/x11/xmx/patches/patch-cl
@@ -0,0 +1,28 @@
+$NetBSD: patch-cl,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/pp.c~ 1998-04-23 18:19:10.000000000 -0400
++++ server/pp.c 2008-08-31 01:39:38.000000000 -0400
+@@ -29,6 +29,8 @@
+ * They don't belong anywhere else, so they're here. *
+ * *
+ ************************************************************************/
++#include <stdlib.h>
++#include <string.h>
+ #define NEED_REPLIES
+ #define NEED_EVENTS
+ #include <X11/Xproto.h>
+@@ -62,8 +64,12 @@ pp_new
+ pp = ppfree;
+ ppfree = ppfree->next;
+ }
+- else if (MALLOC(pp, pp_t *, sizeof(pp_t)))
+- return (pp_t *)err(0, "malloc returned zero");
++ else if (MALLOC(pp, pp_t *, sizeof(pp_t))) {
++ /* this err returns its first argument */
++ /*return (pp_t *)err(0, "malloc returned zero");*/
++ err(0, "malloc returned zero");
++ return NULL;
++ }
+
+ return pp;
+ }
diff --git a/x11/xmx/patches/patch-cm b/x11/xmx/patches/patch-cm
new file mode 100644
index 00000000000..88526677ac7
--- /dev/null
+++ b/x11/xmx/patches/patch-cm
@@ -0,0 +1,14 @@
+$NetBSD: patch-cm,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/prop.c~ 1998-04-08 15:22:15.000000000 -0400
++++ server/prop.c 2008-08-31 01:40:05.000000000 -0400
+@@ -25,6 +25,9 @@
+ * prop.c *
+ * *
+ ************************************************************************/
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #include <X11/X.h>
+ #define NEED_EVENTS
+ #include <X11/Xproto.h>
diff --git a/x11/xmx/patches/patch-cn b/x11/xmx/patches/patch-cn
new file mode 100644
index 00000000000..8713249edcb
--- /dev/null
+++ b/x11/xmx/patches/patch-cn
@@ -0,0 +1,12 @@
+$NetBSD: patch-cn,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/proto.c~ 1998-04-22 18:54:02.000000000 -0400
++++ server/proto.c 2008-08-31 01:41:05.000000000 -0400
+@@ -38,6 +38,7 @@
+ * This construction is primarily to reduce typing. *
+ * *
+ ************************************************************************/
++#include <string.h>
+ #include <X11/X.h>
+ #include <X11/Xlib.h>
+ #include <X11/Xatom.h>
diff --git a/x11/xmx/patches/patch-co b/x11/xmx/patches/patch-co
new file mode 100644
index 00000000000..16f737d255e
--- /dev/null
+++ b/x11/xmx/patches/patch-co
@@ -0,0 +1,12 @@
+$NetBSD: patch-co,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/ptc.c~ 1998-04-27 11:31:58.000000000 -0400
++++ server/ptc.c 2008-08-31 01:41:24.000000000 -0400
+@@ -28,6 +28,7 @@
+ * and apply X protocol translation "programs." *
+ * *
+ ************************************************************************/
++#include <stdlib.h>
+ #define NEED_REPLIES
+ #define NEED_EVENTS
+ #include <X11/X.h>
diff --git a/x11/xmx/patches/patch-cp b/x11/xmx/patches/patch-cp
new file mode 100644
index 00000000000..e837184b094
--- /dev/null
+++ b/x11/xmx/patches/patch-cp
@@ -0,0 +1,12 @@
+$NetBSD: patch-cp,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/es.h~ 1997-09-27 17:10:13.000000000 -0400
++++ server/es.h 2008-08-31 01:42:57.000000000 -0400
+@@ -25,5 +25,5 @@
+ * es.h *
+ * *
+ ************************************************************************/
+-#define es_set(chp, n) (chp)->dptr = (void *)(n)
+-#define es_get(chp) ((int)chp->dptr)
++#define es_set(chp, n) (chp)->dptr = (void *)(intptr_t)(n)
++#define es_get(chp) ((int)(intptr_t)chp->dptr)
diff --git a/x11/xmx/patches/patch-cq b/x11/xmx/patches/patch-cq
new file mode 100644
index 00000000000..290f7047afd
--- /dev/null
+++ b/x11/xmx/patches/patch-cq
@@ -0,0 +1,33 @@
+$NetBSD: patch-cq,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/ptc.h.orig 1998-04-22 17:09:58.000000000 -0400
++++ server/ptc.h 2008-08-31 02:08:04.000000000 -0400
+@@ -167,6 +167,10 @@ typedef struct {
+ * Ops - inlined *
+ * *
+ ************************************************************************/
++#include <X11/Xproto.h>
++#include "df.h"
++#include "incl/ptc.pvt.h"
++
+ #define ptc_empty(ptcp) ((ptcp)->pc == 0 && (ptcp)->head == (ptcp)->tail)
+
+ #define PTC_ALIGN(ptcp, _m) {\
+@@ -200,7 +204,7 @@ typedef struct {
+ if ((ptcp)->pc > PTC_LASTPC - sizeof(_type)) {\
+ register char *_cp;\
+ \
+- _cp = (char *)ptc_new_block();\
++ _cp = ptc_new_block();\
+ PTC_JUMP((ptcp), _cp);\
+ (ptcp)->tail = _cp;\
+ (ptcp)->pc = 0;\
+@@ -219,7 +223,7 @@ typedef struct {
+ }
+
+ #define PTC_GET(bp, clinum, seqno) ((buf_chunk(bp))->type == P_REQUEST ?\
+- (ptc_t *)((buf_chunk(bp))->dptr) : (ptc_t *)ptc_set(bp, clinum, seqno))
++ (ptc_t *)((buf_chunk(bp))->dptr) : ptc_set(bp, clinum, seqno))
+
+ #define PTC_INCR_COUNT(ptcp) (ptcp)->count++
+ #define PTC_CLEAR_COUNT(ptcp) (ptcp)->count = 0
diff --git a/x11/xmx/patches/patch-cr b/x11/xmx/patches/patch-cr
new file mode 100644
index 00000000000..13719a8004e
--- /dev/null
+++ b/x11/xmx/patches/patch-cr
@@ -0,0 +1,12 @@
+$NetBSD: patch-cr,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/request.c~ 1998-04-29 14:54:43.000000000 -0400
++++ server/request.c 2008-08-31 01:48:49.000000000 -0400
+@@ -31,6 +31,7 @@
+ #ifdef _AIX
+ #include <sys/select.h>
+ #endif
++#include <stdlib.h>
+ #define NEED_REPLIES
+ #define NEED_EVENTS
+ #include <X11/Xproto.h>
diff --git a/x11/xmx/patches/patch-cs b/x11/xmx/patches/patch-cs
new file mode 100644
index 00000000000..84c8d5fdbcb
--- /dev/null
+++ b/x11/xmx/patches/patch-cs
@@ -0,0 +1,12 @@
+$NetBSD: patch-cs,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/gc.c~ 1998-05-01 22:46:46.000000000 -0400
++++ server/gc.c 2008-08-31 01:58:25.000000000 -0400
+@@ -25,6 +25,7 @@
+ * gc.c *
+ * *
+ ************************************************************************/
++#include <stdlib.h>
+ #include <X11/Xproto.h>
+ #include <X11/X.h>
+ #include "xmx.h"
diff --git a/x11/xmx/patches/patch-ct b/x11/xmx/patches/patch-ct
new file mode 100644
index 00000000000..9752c859410
--- /dev/null
+++ b/x11/xmx/patches/patch-ct
@@ -0,0 +1,13 @@
+$NetBSD: patch-ct,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/queue.c~ 1998-04-27 11:32:19.000000000 -0400
++++ server/queue.c 2008-08-31 01:59:07.000000000 -0400
+@@ -36,6 +36,8 @@
+ #include <netinet/in.h> /* ip.h needs this */
+ #include <netinet/in_systm.h> /* ...and this */
+ #include <netinet/ip.h> /* for IP_MAXPACKET */
++#include <stdlib.h>
++#include <string.h>
+ #include <errno.h>
+
+ #include <X11/X.h>
diff --git a/x11/xmx/patches/patch-cu b/x11/xmx/patches/patch-cu
new file mode 100644
index 00000000000..068d9561dad
--- /dev/null
+++ b/x11/xmx/patches/patch-cu
@@ -0,0 +1,20 @@
+$NetBSD: patch-cu,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/df.h~ 1997-09-27 17:10:13.000000000 -0400
++++ server/df.h 2008-08-31 02:08:49.000000000 -0400
+@@ -26,6 +26,9 @@
+ * *
+ ************************************************************************/
+
++#ifndef DF_H_INCLUDED
++#define DF_H_INCLUDED
++
+ #define DF_NVALS 256
+ /*
+ ** The two broad classes of data we need to handle are integers
+@@ -52,3 +55,5 @@ typedef struct _df_t {
+ df_block_t * curblkp;
+ struct _df_t * next;
+ }df_t;
++
++#endif /* DF_H_INCLUDED */
diff --git a/x11/xmx/patches/patch-cv b/x11/xmx/patches/patch-cv
new file mode 100644
index 00000000000..d0c5954a1cd
--- /dev/null
+++ b/x11/xmx/patches/patch-cv
@@ -0,0 +1,23 @@
+$NetBSD: patch-cv,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/rgb.c~ 1997-10-10 09:17:56.000000000 -0400
++++ server/rgb.c 2008-08-31 02:12:44.000000000 -0400
+@@ -31,7 +31,8 @@
+ ************************************************************************/
+ #include <sys/param.h>
+ #include <stdio.h>
+-#include "xmx.h"
++#include <stdlib.h>
++#include <string.h>
+
+ #ifdef NDBM
+ #include <ndbm.h>
+@@ -45,6 +46,8 @@
+ #endif
+ #endif
+
++#include "xmx.h"
++
+ typedef struct {
+ char * name;
+ u16_t namelen;
diff --git a/x11/xmx/patches/patch-cw b/x11/xmx/patches/patch-cw
new file mode 100644
index 00000000000..d31908c72a0
--- /dev/null
+++ b/x11/xmx/patches/patch-cw
@@ -0,0 +1,12 @@
+$NetBSD: patch-cw,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/rs.c~ 1997-08-19 12:24:33.000000000 -0400
++++ server/rs.c 2008-08-31 02:12:52.000000000 -0400
+@@ -28,6 +28,7 @@
+ * with the major and minor reply codes. *
+ * *
+ ************************************************************************/
++#include <stdlib.h>
+ #include "xmx.h"
+ #include "rs.h"
+ #include "incl/rs.pvt.h"
diff --git a/x11/xmx/patches/patch-cx b/x11/xmx/patches/patch-cx
new file mode 100644
index 00000000000..4e409cdb065
--- /dev/null
+++ b/x11/xmx/patches/patch-cx
@@ -0,0 +1,12 @@
+$NetBSD: patch-cx,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/rx.c~ 1998-02-04 14:54:56.000000000 -0500
++++ server/rx.c 2008-08-31 02:15:00.000000000 -0400
+@@ -38,6 +38,7 @@
+ * less explicit overhead. *
+ * *
+ ************************************************************************/
++#include <stdlib.h>
+ #define NEED_REPLIES
+ #define NEED_EVENTS
+ #include <X11/X.h>
diff --git a/x11/xmx/patches/patch-cy b/x11/xmx/patches/patch-cy
new file mode 100644
index 00000000000..9edb5073d3b
--- /dev/null
+++ b/x11/xmx/patches/patch-cy
@@ -0,0 +1,13 @@
+$NetBSD: patch-cy,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/sel.c~ 1998-03-31 14:22:36.000000000 -0500
++++ server/sel.c 2008-08-31 02:15:35.000000000 -0400
+@@ -27,6 +27,8 @@
+ * Selections. *
+ * *
+ ************************************************************************/
++#include <stdio.h>
++#include <stdlib.h>
+ #include <X11/X.h>
+ #define NEED_EVENTS
+ #include <X11/Xproto.h>
diff --git a/x11/xmx/patches/patch-cz b/x11/xmx/patches/patch-cz
new file mode 100644
index 00000000000..c9eb31e8c7a
--- /dev/null
+++ b/x11/xmx/patches/patch-cz
@@ -0,0 +1,13 @@
+$NetBSD: patch-cz,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/server.c~ 1998-04-27 11:38:10.000000000 -0400
++++ server/server.c 2008-08-31 02:16:00.000000000 -0400
+@@ -27,6 +27,8 @@
+ * Routines to manage X server list. *
+ * *
+ ************************************************************************/
++#include <stdlib.h>
++#include <string.h>
+ #define NEED_REPLIES
+ #define NEED_EVENTS
+ #include <X11/Xproto.h>
diff --git a/x11/xmx/patches/patch-da b/x11/xmx/patches/patch-da
new file mode 100644
index 00000000000..7e7f004ff71
--- /dev/null
+++ b/x11/xmx/patches/patch-da
@@ -0,0 +1,12 @@
+$NetBSD: patch-da,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/sm.c~ 1998-04-09 11:19:36.000000000 -0400
++++ server/sm.c 2008-08-31 02:20:32.000000000 -0400
+@@ -40,6 +40,7 @@
+ * should do as little as possible. *
+ * *
+ ************************************************************************/
++#include <stdlib.h>
+ #include "xmx.h"
+ #include "df.h"
+ #include "cx.h"
diff --git a/x11/xmx/patches/patch-db b/x11/xmx/patches/patch-db
new file mode 100644
index 00000000000..1eb91ea9a31
--- /dev/null
+++ b/x11/xmx/patches/patch-db
@@ -0,0 +1,41 @@
+$NetBSD: patch-db,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/socket.c~ 1998-01-08 14:59:17.000000000 -0500
++++ server/socket.c 2008-08-31 02:22:10.000000000 -0400
+@@ -37,6 +37,9 @@
+ #include <netinet/in.h>
+ #include <netinet/tcp.h>
+ #endif
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #include <netdb.h>
+ #include <fcntl.h>
+ #include <errno.h>
+@@ -84,7 +87,7 @@ socket_as_Xserver
+ if (!mkdir(X_UNIX_DIR, 0777))
+ chmod(X_UNIX_DIR, 0777);
+
+- (void)sprintf(xpath, "%s%d", X_UNIX_PATH, display);
++ (void)snprintf(xpath, sizeof(xpath), "%s%d", X_UNIX_PATH, display);
+ rv = create_port(XPORT, X_TCP_PORT+display, xpath);
+
+ (void)umask(umsk);
+@@ -111,7 +114,7 @@ socket_as_xmc
+ if (!mkdir(XMC_UNIX_DIR, 0777))
+ chmod(XMC_UNIX_DIR, 0777);
+
+- (void)sprintf(xmcpath, "%s%d", XMC_UNIX_PATH, display);
++ (void)snprintf(xmcpath, sizeof(xmcpath), "%s%d", XMC_UNIX_PATH, display);
+ rv = create_port(XMCPORT, XMC_TCP_PORT-display, xmcpath);
+
+ (void)umask(umsk);
+@@ -393,7 +396,7 @@ socket_as_client
+ case FamilyLocal:
+ #ifdef UNIXCONN
+ usock.sun_family = AF_UNIX;
+- sprintf(usock.sun_path, "%s%d", X_UNIX_PATH, display);
++ snprintf(usock.sun_path, sizeof(usock.sun_path), "%s%d", X_UNIX_PATH, display);
+ if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
+ return perr(-1, usock.sun_path);
+ sock = (struct sockaddr *)&usock;
diff --git a/x11/xmx/patches/patch-dc b/x11/xmx/patches/patch-dc
new file mode 100644
index 00000000000..6a795c1f796
--- /dev/null
+++ b/x11/xmx/patches/patch-dc
@@ -0,0 +1,12 @@
+$NetBSD: patch-dc,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/sres.c~ 1998-05-07 13:52:45.000000000 -0400
++++ server/sres.c 2008-08-31 02:22:31.000000000 -0400
+@@ -27,6 +27,7 @@
+ * Server resources. *
+ * *
+ ************************************************************************/
++#include <stdlib.h>
+ #include <X11/Xproto.h>
+ #include <X11/X.h>
+ #include "xmx.h"
diff --git a/x11/xmx/patches/patch-dd b/x11/xmx/patches/patch-dd
new file mode 100644
index 00000000000..a57c7452630
--- /dev/null
+++ b/x11/xmx/patches/patch-dd
@@ -0,0 +1,12 @@
+$NetBSD: patch-dd,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/sv.c~ 1997-09-23 11:40:11.000000000 -0400
++++ server/sv.c 2008-08-31 02:22:55.000000000 -0400
+@@ -35,6 +35,7 @@
+ #ifdef _AIX
+ #include <sys/select.h>
+ #endif
++#include <stdlib.h>
+ #include "xmx.h"
+ #include "sv.h"
+ #include "incl/sv.pvt.h"
diff --git a/x11/xmx/patches/patch-de b/x11/xmx/patches/patch-de
new file mode 100644
index 00000000000..d9c1990d404
--- /dev/null
+++ b/x11/xmx/patches/patch-de
@@ -0,0 +1,21 @@
+$NetBSD: patch-de,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/time.c~ 1998-03-31 14:12:31.000000000 -0500
++++ server/time.c 2008-08-31 02:23:31.000000000 -0400
+@@ -30,6 +30,8 @@
+ #ifdef _AIX
+ #include <sys/select.h>
+ #endif
++#include <stdio.h>
++#include <stdlib.h>
+ #include "xmx.h"
+ #include "fd.h"
+ #include "incl/time.pvt.h"
+@@ -232,6 +234,6 @@ time_str
+
+ cp = &buf[cur++][0];
+ cur %= 6;
+- sprintf(cp, "%u/%u", tp->mo, tp->ms); /* cannot exceed 24 in length */
++ snprintf(cp, 24, "%u/%u", tp->mo, tp->ms); /* cannot exceed 24 in length */
+ return cp;
+ }
diff --git a/x11/xmx/patches/patch-df b/x11/xmx/patches/patch-df
new file mode 100644
index 00000000000..7b849ebe042
--- /dev/null
+++ b/x11/xmx/patches/patch-df
@@ -0,0 +1,12 @@
+$NetBSD: patch-df,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/tptr.c~ 1998-05-04 16:54:58.000000000 -0400
++++ server/tptr.c 2008-08-31 02:24:39.000000000 -0400
+@@ -31,6 +31,7 @@
+ #ifdef _AIX
+ #include <sys/select.h>
+ #endif
++#include <stdlib.h>
+ #define NEED_REPLIES
+ #define NEED_EVENTS
+ #include <X11/X.h>
diff --git a/x11/xmx/patches/patch-dg b/x11/xmx/patches/patch-dg
new file mode 100644
index 00000000000..b8938b884e0
--- /dev/null
+++ b/x11/xmx/patches/patch-dg
@@ -0,0 +1,14 @@
+$NetBSD: patch-dg,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/util.c~ 1998-04-16 18:08:50.000000000 -0400
++++ server/util.c 2008-08-31 02:25:16.000000000 -0400
+@@ -35,6 +35,9 @@
+ #ifdef SVR4
+ #include <sys/utsname.h>
+ #endif
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #include <signal.h>
+
+ #include <X11/X.h>
diff --git a/x11/xmx/patches/patch-dh b/x11/xmx/patches/patch-dh
new file mode 100644
index 00000000000..f56ee1a7231
--- /dev/null
+++ b/x11/xmx/patches/patch-dh
@@ -0,0 +1,14 @@
+$NetBSD: patch-dh,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/vconf.c~ 1998-05-05 15:00:20.000000000 -0400
++++ server/vconf.c 2008-08-31 02:26:08.000000000 -0400
+@@ -43,6 +43,9 @@
+ * without merging. *
+ * *
+ ************************************************************************/
++#include <stdlib.h>
++#include <string.h>
++
+ #include <X11/X.h>
+ #define NEED_REPLIES
+ #define NEED_EVENTS
diff --git a/x11/xmx/patches/patch-di b/x11/xmx/patches/patch-di
new file mode 100644
index 00000000000..8bf53840527
--- /dev/null
+++ b/x11/xmx/patches/patch-di
@@ -0,0 +1,12 @@
+$NetBSD: patch-di,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/window.c~ 1998-05-04 17:30:15.000000000 -0400
++++ server/window.c 2008-08-31 02:26:35.000000000 -0400
+@@ -25,6 +25,7 @@
+ * window.c *
+ * *
+ ************************************************************************/
++#include <stdlib.h>
+ #include <X11/X.h>
+ #define NEED_EVENTS
+ #include <X11/Xproto.h>
diff --git a/x11/xmx/patches/patch-dj b/x11/xmx/patches/patch-dj
new file mode 100644
index 00000000000..77b3594f219
--- /dev/null
+++ b/x11/xmx/patches/patch-dj
@@ -0,0 +1,13 @@
+$NetBSD: patch-dj,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/xmc.c~ 1998-04-01 18:45:05.000000000 -0500
++++ server/xmc.c 2008-08-31 02:26:54.000000000 -0400
+@@ -32,6 +32,8 @@
+ #ifdef _AIX
+ #include <sys/select.h>
+ #endif
++#include <stdlib.h>
++#include <string.h>
+ #include <X11/X.h>
+ #include <X11/Xproto.h>
+
diff --git a/x11/xmx/patches/patch-dk b/x11/xmx/patches/patch-dk
new file mode 100644
index 00000000000..5bfb8d8ee6c
--- /dev/null
+++ b/x11/xmx/patches/patch-dk
@@ -0,0 +1,12 @@
+$NetBSD: patch-dk,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- server/xmcp.c~ 1998-02-12 17:45:06.000000000 -0500
++++ server/xmcp.c 2008-08-31 02:27:16.000000000 -0400
+@@ -25,6 +25,7 @@
+ * xmcp.c *
+ * *
+ ************************************************************************/
++#include <string.h>
+ #include <xmc.h>
+ #include <xmcp.h>
+ #include "xmx.h"
diff --git a/x11/xmx/patches/patch-ea b/x11/xmx/patches/patch-ea
new file mode 100644
index 00000000000..875ee9eda88
--- /dev/null
+++ b/x11/xmx/patches/patch-ea
@@ -0,0 +1,13 @@
+$NetBSD: patch-ea,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- clients/xmtg/xmtg.c~ 1998-02-12 23:28:47.000000000 -0500
++++ clients/xmtg/xmtg.c 2008-08-31 02:28:42.000000000 -0400
+@@ -30,6 +30,8 @@
+ #endif
+
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #include <X11/Xlib.h>
+
+ #include <X11/Intrinsic.h>
diff --git a/x11/xmx/patches/patch-eb b/x11/xmx/patches/patch-eb
new file mode 100644
index 00000000000..1d8a4ca53ed
--- /dev/null
+++ b/x11/xmx/patches/patch-eb
@@ -0,0 +1,12 @@
+$NetBSD: patch-eb,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- clients/xmtg/node.c~ 1997-05-21 13:15:03.000000000 -0400
++++ clients/xmtg/node.c 2008-08-31 02:30:34.000000000 -0400
+@@ -33,6 +33,7 @@
+ #define MAXHOSTNAMELEN not_defined
+ #endif
+ #endif
++#include <stdlib.h>
+
+ #include <X11/Intrinsic.h>
+ #include "ig.h"
diff --git a/x11/xmx/patches/patch-ec b/x11/xmx/patches/patch-ec
new file mode 100644
index 00000000000..c42ee5c52b1
--- /dev/null
+++ b/x11/xmx/patches/patch-ec
@@ -0,0 +1,13 @@
+$NetBSD: patch-ec,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- clients/xmtg/ig.c~ 1998-04-01 19:19:37.000000000 -0500
++++ clients/xmtg/ig.c 2008-08-31 02:31:03.000000000 -0400
+@@ -40,6 +40,8 @@
+ ************************************************************************/
+ /*** VERSION 0.09 ***/
+
++#include <stdio.h>
++#include <stdlib.h>
+ #include <X11/Intrinsic.h>
+ #include <X11/StringDefs.h>
+ #include "ig.h"
diff --git a/x11/xmx/patches/patch-ed b/x11/xmx/patches/patch-ed
new file mode 100644
index 00000000000..3eaa2f1c614
--- /dev/null
+++ b/x11/xmx/patches/patch-ed
@@ -0,0 +1,28 @@
+$NetBSD: patch-ed,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- clients/xmtg/ui.c.orig 1998-04-01 18:55:00.000000000 -0500
++++ clients/xmtg/ui.c 2008-08-31 02:40:34.000000000 -0400
+@@ -22,10 +22,14 @@
+ */
+ /* next line is debugging...TODO */
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #ifdef __STDC__
++#include <stdint.h>
+ #include <stdarg.h>
+ #else
+ #include <varargs.h>
++typedef long intptr_t; /* best guess... */
+ #endif
+ #include <X11/Xlib.h>
+
+@@ -440,7 +444,7 @@ ui_get_add_info(adp, strp, modep)
+ {
+
+ XtVaGetValues(adp->input, XtNstring, strp, 0);
+- *modep = (int)XawToggleGetCurrent(adp->mode_radio);
++ *modep = (int)(intptr_t)XawToggleGetCurrent(adp->mode_radio);
+ }
+
+ void
diff --git a/x11/xmx/patches/patch-ee b/x11/xmx/patches/patch-ee
new file mode 100644
index 00000000000..9b853a5b041
--- /dev/null
+++ b/x11/xmx/patches/patch-ee
@@ -0,0 +1,12 @@
+$NetBSD: patch-ee,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- clients/xmtg/layout.c~ 1998-04-01 18:56:29.000000000 -0500
++++ clients/xmtg/layout.c 2008-08-31 02:34:22.000000000 -0400
+@@ -31,6 +31,7 @@
+ #include <fcntl.h>
+
+ #include <stdio.h>
++#include <stdlib.h>
+ #include "layout.h"
+
+ int
diff --git a/x11/xmx/patches/patch-ef b/x11/xmx/patches/patch-ef
new file mode 100644
index 00000000000..5dfdfc5c13f
--- /dev/null
+++ b/x11/xmx/patches/patch-ef
@@ -0,0 +1,44 @@
+$NetBSD: patch-ef,v 1.1 2008/08/31 06:52:29 dholland Exp $
+
+--- clients/xmxinit/xmxinit.c~ 1995-04-19 23:05:04.000000000 -0400
++++ clients/xmxinit/xmxinit.c 2008-08-31 02:38:46.000000000 -0400
+@@ -30,7 +30,6 @@ Modified from X11R6 MIT source for xinit
+ #include <sys/wait.h>
+ #endif
+ #include <errno.h>
+-extern int sys_nerr;
+ #include <setjmp.h>
+
+ #ifndef X_NOT_STDC_ENV
+@@ -86,8 +85,8 @@ char **client = clientargv + 2; /* make
+ char *displayNum;
+ char *program;
+ Display *xd; /* server connection */
+-#ifndef SYSV
+-#if defined(SVR4) || defined(_POSIX_SOURCE)
++#if 1 /*ndef SYSV*/
++#if 1 /*defined(SVR4) || defined(_POSIX_SOURCE)*/
+ int status;
+ #else
+ union wait status;
+@@ -350,7 +349,7 @@ processTimeout(timeout, string)
+ break;
+ alarm(0);
+ #else /* SYSV */
+-#if defined(SVR4) || defined(_POSIX_SOURCE)
++#if 1 /*defined(SVR4) || defined(_POSIX_SOURCE)*/
+ if ((pidfound = waitpid(serverpid, &status, WNOHANG)) == serverpid)
+ break;
+ #else
+@@ -588,10 +587,8 @@ Fatal(fmt, x0,x1,x2,x3,x4,x5,x6,x7,x8,x9
+ Error(fmt, x0,x1,x2,x3,x4,x5,x6,x7,x8,x9)
+ char *fmt;
+ {
+- extern char *sys_errlist[];
+-
+ fprintf(stderr, "%s: ", program);
+ if (errno > 0 && errno < sys_nerr)
+- fprintf (stderr, "%s (errno %d): ", sys_errlist[errno], errno);
++ fprintf (stderr, "%s (errno %d): ", strerror(errno), errno);
+ fprintf(stderr, fmt, x0,x1,x2,x3,x4,x5,x6,x7,x8,x9);
+ }