]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tinfo/lib_print.c
ncurses 6.2 - patch 20210227
[ncurses.git] / ncurses / tinfo / lib_print.c
index c7bd3a62fa87b1e3794890f93b8a4fb0c25b0404..4accdf6786ea7a7701955d3b5f852e8e82165bff 100644 (file)
@@ -1,5 +1,6 @@
 /****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
+ * Copyright 2018,2020 Thomas E. Dickey                                     *
+ * Copyright 1998-2011,2012 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -39,7 +40,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_print.c,v 1.20 2010/06/05 22:18:35 tom Exp $")
+MODULE_ID("$Id: lib_print.c,v 1.28 2020/08/29 16:22:03 juergen Exp $")
 
 NCURSES_EXPORT(int)
 NCURSES_SP_NAME(mcprint) (NCURSES_SP_DCLx char *data, int len)
@@ -59,7 +60,7 @@ NCURSES_SP_NAME(mcprint) (NCURSES_SP_DCLx char *data, int len)
     }
 
     if (prtr_non) {
-       switchon = TPARM_1(prtr_non, len);
+       switchon = TIPARM_1(prtr_non, len);
        onsize = strlen(switchon);
        offsize = 0;
     } else {
@@ -76,10 +77,10 @@ NCURSES_SP_NAME(mcprint) (NCURSES_SP_DCLx char *data, int len)
        return (ERR);
     }
 
-    (void) strcpy(mybuf, switchon);
-    memcpy(mybuf + onsize, data, (unsigned) len);
+    _nc_STRCPY(mybuf, switchon, need);
+    memcpy(mybuf + onsize, data, (size_t) len);
     if (offsize)
-       (void) strcpy(mybuf + onsize + len, prtr_off);
+       _nc_STRCPY(mybuf + onsize + len, prtr_off, need);
 
     /*
      * We're relying on the atomicity of UNIX writes here.  The
@@ -95,7 +96,7 @@ NCURSES_SP_NAME(mcprint) (NCURSES_SP_DCLx char *data, int len)
      * kernel will ship the contiguous clist items from the last write
      * immediately.
      */
-#ifndef __MINGW32__
+#ifndef _NC_WINDOWS
     (void) sleep(0);
 #endif
     free(mybuf);