$OpenBSD: patch-zebedee_c,v 1.1.1.1 2001/10/31 18:04:54 lebel Exp $
--- zebedee.c.orig	Fri Apr 13 16:42:24 2001
+++ zebedee.c	Wed Oct 31 10:44:58 2001
@@ -940,7 +940,7 @@ message(unsigned short level, int err, c
     ** error number!
     */
 
-    sprintf(msgBuf, "%s(%lu/%lu): %s%s%.*s%s",
+    sprintf(msgBuf, "%.64s(%lu/%lu): %s%s%.*s%s",
 	    Program, (threadPid() % 100000), (threadTid() % 100000),
 	    (timePtr ? timePtr : ""), (timePtr ? ": " : ""),
 	    level, "          ", (level ? "" : "ERROR: "));
@@ -2969,7 +2969,7 @@ spawnCommand(unsigned short port, char *
     char *shell = DFLT_SHELL;
     char cmdBuf[MAX_LINE_SIZE];
 
-    sprintf(cmdBuf, cmdFormat, (int)port);
+    snprintf(cmdBuf, sizeof(cmdBuf), cmdFormat, (int)port);
 
     if (((shell = getenv("SHELL")) == NULL) || *shell == '\0')
     {
@@ -3105,8 +3105,12 @@ filterLoop(int localFd, int remoteFd, Ms
 		}
 		else
 		{
-		    num = send(localFd, (char *)(msgBuf->data),
-			       msgBuf->size, 0);
+                    int i;
+                    num = 0;
+                    do
+                    {
+		        i = send(localFd, (char *)(msgBuf->data)+num, msgBuf->size-num, 0);
+                    } while ((i != -1) && ((num+=i) < msgBuf->size));
 		}
 		if (num != msgBuf->size)
 		{
