$OpenBSD: patch-textedit_c,v 1.1 2007/10/26 20:49:32 ajacoutot Exp $
--- textedit.c.orig	Wed Apr 19 00:53:43 1995
+++ textedit.c	Fri Oct 26 22:45:17 2007
@@ -17,7 +17,7 @@ static char sccsid[] = "@(#)textedit.c 15.50 90/05/22"
 
 #include <fcntl.h>
 #include <stdio.h>
-#include <strings.h>
+#include <string.h>
 #include <X11/X.h>
 #include <xview/defaults.h>
 #include <xview/font.h>
@@ -31,19 +31,11 @@ static char sccsid[] = "@(#)textedit.c 15.50 90/05/22"
 #include <xview/sel_svc.h>
 #include <xview/sel_attrs.h>
 
-#ifdef ecd.help
+#ifdef ecd_help
 #include <suntool/help.h>
 #endif
 
-/*
- * The presence of this line caused textedit not to be built
- * The function is already defined in the XView libraries
-long	textsw_store_file();
-*/
-char	*getwd();
-#ifndef __linux
-char *sprintf();
-#endif
+static void die(char *m1, char *m2, char *m3);
 void	frame_cmdline_help();
 static int		off();
 static Notify_value	mysigproc();
@@ -312,7 +304,8 @@ Update_icon_text:
 	if (pass_on)
 	    (void)textsw_default_notify(textsw_local, attributes);
 	if (repaint) {
-	    (void)sprintf(frame_label, "%s Text Editor - %s%s, dir; %s",
+	    (void)snprintf(frame_label, sizeof(frame_label),
+			"%s Text Editor - %s%s, dir; %s",
 		    (caps_lock_on) ? "[CAPS] " : "",
 		    current_filename,
 		    (was_read_only) ? " (read only)"
@@ -521,7 +514,7 @@ textedit_main(argc, argv)
 	    FRAME_LABEL,		"Text Editor",
 	    FRAME_SHOW_LABEL,		TRUE,
 	    FRAME_CMDLINE_HELP_PROC,	my_frame_help,
-#ifdef ecd.help
+#ifdef ecd_help
 	    HELP_DATA,			"sunview:textedit",
 #endif
 	    0);
@@ -998,7 +991,7 @@ Die:
 /*
  * Misc. utilities
  */
-static
+static void
 die(msg1, msg2, msg3)
 	char	*msg1, *msg2, *msg3;
 {
