diff -ruN scim-bridge-0.4.16/agent/scim-bridge-agent-client-listener.cpp scim-bridge-0.4.16.sol10/agent/scim-bridge-agent-client-listener.cpp
--- scim-bridge-0.4.16/agent/scim-bridge-agent-client-listener.cpp	2008-11-02 07:44:49.000000000 +0100
+++ scim-bridge-0.4.16.sol10/agent/scim-bridge-agent-client-listener.cpp	2011-01-05 19:18:31.000000000 +0100
@@ -26,6 +26,7 @@
 #include <sys/socket.h>
 #include <sys/time.h>
 #include <sys/types.h>
+#include <alloca.h>
 
 #include <list>
 
diff -ruN scim-bridge-0.4.16/agent/scim-bridge-agent-output.cpp scim-bridge-0.4.16.sol10/agent/scim-bridge-agent-output.cpp
--- scim-bridge-0.4.16/agent/scim-bridge-agent-output.cpp	2008-11-02 07:44:49.000000000 +0100
+++ scim-bridge-0.4.16.sol10/agent/scim-bridge-agent-output.cpp	2011-01-05 19:24:48.000000000 +0100
@@ -24,6 +24,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <syslog.h>
+#include <alloca.h>
 
 #include "scim-bridge-debug.h"
 #include "scim-bridge-output.h"
@@ -33,6 +34,89 @@
 
 static const char SCIM_BRIDGE_AGENT_PROCESS_NAME[] = "scim-bridge";
 
+/* The code of this function is from libiberty -- rs@mytum.de 2011-01-05 */
+int vasprintf0(char **result,const char *format,va_list *args)
+{
+  const char *p = format;
+  /* Add one to make sure that it is never zero, which might cause malloc
+     to return NULL.  */
+  int total_width = strlen (format) + 1;
+  va_list ap;
+ 
+  memcpy (&ap, args, sizeof (va_list));
+
+  while (*p != '\0')
+    {
+      if (*p++ == '%')
+	{
+	  while (strchr ("-+ #0", *p))
+	    ++p;
+	  if (*p == '*')
+	    {
+	      ++p;
+	      total_width += abs (va_arg (ap, int));
+	    }
+	  else
+	    total_width += strtoul (p, (char **) &p, 10);
+	  if (*p == '.')
+	    {
+	      ++p;
+	      if (*p == '*')
+		{
+		  ++p;
+		  total_width += abs (va_arg (ap, int));
+		}
+	      else
+	      total_width += strtoul (p, (char **) &p, 10);
+	    }
+	  while (strchr ("hlL", *p))
+	    ++p;
+	  /* Should be big enough for any format specifier except %s and floats.  */
+	  total_width += 30;
+	  switch (*p)
+	    {
+	    case 'd':
+	    case 'i':
+	    case 'o':
+	    case 'u':
+	    case 'x':
+	    case 'X':
+	    case 'c':
+	      (void) va_arg (ap, int);
+	      break;
+	    case 'f':
+	    case 'e':
+	    case 'E':
+	    case 'g':
+	    case 'G':
+	      (void) va_arg (ap, double);
+	      /* Since an ieee double can have an exponent of 307, we'll
+		 make the buffer wide enough to cover the gross case. */
+	      total_width += 307;
+	      break;
+	    case 's':
+	      total_width += strlen (va_arg (ap, char *));
+	      break;
+	    case 'p':
+	    case 'n':
+	      (void) va_arg (ap, char *);
+	      break;
+	    }
+	  p++;
+	}
+    }
+  *result = (char *)malloc (total_width);
+  if (*result != NULL)
+    return vsprintf (*result, format, *args);
+  else
+    return 0;
+}
+
+int vasprintf(char **result,const char *format,va_list args)
+{
+  return vasprintf0(result, format, &args);
+}
+
 
 /* Helper functions */
 void static_initialize ()
diff -ruN scim-bridge-0.4.16/agent/utils/daemon-impl.h scim-bridge-0.4.16.sol10/agent/utils/daemon-impl.h
--- scim-bridge-0.4.16/agent/utils/daemon-impl.h	1970-01-01 01:00:00.000000000 +0100
+++ scim-bridge-0.4.16.sol10/agent/utils/daemon-impl.h	2011-01-05 20:14:02.392505000 +0100
@@ -0,0 +1,72 @@
+/*-
+ * Copyright (c) 1990, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *	This product includes software developed by the University of
+ *	California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char rcsid[] = "$OpenBSD: daemon.c,v 1.4 1995/02/25 13:41:16 cgd Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include <sys/types.h>
+/*#include "config.h"*/
+
+#include <fcntl.h>
+#include <unistd.h>
+
+int
+daemon(int nochdir,int noclose)
+{
+	int fd;
+
+	switch (fork()) {
+	case -1:
+		return (-1);
+	case 0:
+		break;
+	default:
+		_exit(0);
+	}
+
+	if (setsid() == -1)
+		return (-1);
+
+	if (!nochdir)
+		(void)chdir("/");
+
+	if (!noclose && (fd = open("/dev/null", O_RDWR, 0)) != -1) {
+		(void)dup2(fd, STDIN_FILENO);
+		(void)dup2(fd, STDOUT_FILENO);
+		(void)dup2(fd, STDERR_FILENO);
+		if (fd > 2)
+			(void)close (fd);
+	}
+	return (0);
+}
diff -ruN scim-bridge-0.4.16/agent/utils/scim-bridge-agent-panel-client.cpp scim-bridge-0.4.16.sol10/agent/utils/scim-bridge-agent-panel-client.cpp
--- scim-bridge-0.4.16/agent/utils/scim-bridge-agent-panel-client.cpp	2009-01-17 18:20:15.000000000 +0100
+++ scim-bridge-0.4.16.sol10/agent/utils/scim-bridge-agent-panel-client.cpp	2011-01-05 20:15:16.434567000 +0100
@@ -35,6 +35,7 @@
 
 #include "scim-bridge-agent-panel-client.h"
 #include "scim-bridge-output.h"
+#include "daemon-impl.h"
 
 using std::vector;
 
