$NetBSD: patch-bj,v 1.3 2006/01/07 21:08:12 joerg Exp $

--- clients/uil/UilDiags.c.orig	2006-01-06 20:46:16.000000000 +0100
+++ clients/uil/UilDiags.c
@@ -293,12 +293,12 @@ void	diag_issue_diagnostic
     va_start(ap, l_start_column);
 
 #ifndef NO_MESSAGE_CATALOG
-    vsprintf( msg_buffer, 
+    vsnprintf( msg_buffer, sizeof(msg_buffer),
 	      catgets(uil_catd, UIL_SET1, msg_cat_table[ message_number ],
 		      diag_rz_msg_table[ message_number ].ac_text), 
 	     ap );
 #else
-    vsprintf( msg_buffer, 
+    vsnprintf( msg_buffer, sizeof(msg_buffer), 
 	      diag_rz_msg_table[ message_number ].ac_text, 
 	      ap );
 #endif
@@ -317,13 +317,13 @@ void	diag_issue_diagnostic
 	    */
 
 #ifndef NO_MESSAGE_CATALOG
-	    sprintf( loc_buffer,
+	    snprintf( loc_buffer, sizeof(loc_buffer),
 		     catgets(uil_catd, UIL_SET_MISC,
 			     UIL_MISC_0, "\t\t line: %d  file: %s"),
 		     az_src_rec->w_line_number,
 		     src_get_file_name( az_src_rec ) );
 #else
-	    sprintf( loc_buffer,
+	    snprintf( loc_buffer, sizeof(loc_buffer),
 		     "\t\t line: %d  file: %s",
 		     az_src_rec->w_line_number,
 		     src_get_file_name( az_src_rec ) );
@@ -371,7 +371,7 @@ void	diag_issue_diagnostic
 
 	    if (l_start_column != diag_k_no_column)
 #ifndef NO_MESSAGE_CATALOG
-	      sprintf(loc_buffer,
+	      snprintf(loc_buffer, sizeof(loc_buffer),
 		      catgets(uil_catd, UIL_SET_MISC,
 			      UIL_MISC_1, 
 			      "\t\t line: %d  position: %d  file: %s"),
@@ -379,7 +379,7 @@ void	diag_issue_diagnostic
 		      l_start_column + 1,
 		      src_get_file_name( az_src_rec ) );
 #else
-	      sprintf(loc_buffer,
+	      snprintf(loc_buffer, sizeof(loc_buffer),
 		      "\t\t line: %d  position: %d  file: %s",
 		      az_src_rec->w_line_number,
 		      l_start_column + 1,
@@ -387,13 +387,14 @@ void	diag_issue_diagnostic
 #endif
 	    else
 #ifndef NO_MESSAGE_CATALOG
-		sprintf( loc_buffer, catgets(uil_catd, UIL_SET_MISC,
+		snprintf( loc_buffer, sizeof(loc_buffer),
+			 catgets(uil_catd, UIL_SET_MISC,
 					     UIL_MISC_0,
 					     "\t\t line: %d  file: %s"),
 			 az_src_rec->w_line_number,
 			 src_get_file_name( az_src_rec ) );
 #else
-		sprintf( loc_buffer,
+		snprintf( loc_buffer, sizeof(loc_buffer),
 			 "\t\t line: %d  file: %s",
 			 az_src_rec->w_line_number,
 			 src_get_file_name( az_src_rec ) );
