$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;
    }
 }
