$OpenBSD: patch-Wnn_uum_termio_c,v 1.3 2017/04/29 14:31:40 espie Exp $
--- Wnn/uum/termio.c.orig
+++ Wnn/uum/termio.c
@@ -59,7 +59,8 @@
 #ifdef putchar
 #undef putchar
 #endif
-extern int putchar();
+#include <string.h>
+#include <stdlib.h>
 
 extern char Term_Name[];
 extern char    *Term_UnderScoreStart;
@@ -93,7 +94,7 @@ openTermData()
         fprintf(stderr, "Cannot get terminal name.");
         return(-1);
     }
-    strcpy(Term_Name, cp);
+    strlcpy(Term_Name, cp, 128);
 
     if ((strlen(Term_Name) > 2) && (strcmp(Term_Name + (strlen(Term_Name) - 2),"-j") == 0)) {
 	fprintf(stderr, MSG_GET(4));
@@ -102,11 +103,13 @@ openTermData()
 	*/
 	return(-1);
     }
+#ifndef __OpenBSD__
     setupterm(0,1,&status);
     reset_shell_mode();
     if (status != 1){
         return(-1);
     }
+#endif
 #if defined(uniosu)
     if(jterm < 2) {	/* kanji terminal */
         fprintf(stderr, "Not kanji terminal. Goodbye !\n");
@@ -119,13 +122,15 @@ openTermData()
          fprintf(stderr, "Your terminal is not strong enough. Goodbye !\n");
          return(-1);
     }
+#if 0
     termchar[0] = 0;
     strcat(termchar,cp);
     strcat(termchar,"-j");
     setenv("TERM", termchar);
+#endif
 
     sprintf(lcode,"%d", lines - conv_lines);
-    setenv("LINES", lcode);
+    setenv("LINES", lcode, 1);
 
     if(cursor_normal && cursor_invisible){
 	cursor_invisible_fun = 1;
