X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=ncurses%2Ftinfo%2Flib_print.c;h=25e45170b68e22a1623ec2274915eea3749b5581;hb=a7e05fb9806cc1255b6ba4fb29e15d337f35b2ad;hp=c7bd3a62fa87b1e3794890f93b8a4fb0c25b0404;hpb=6b43eaddcd1d9397fb3d51ce4c34f02472e93417;p=ncurses.git diff --git a/ncurses/tinfo/lib_print.c b/ncurses/tinfo/lib_print.c index c7bd3a62..25e45170 100644 --- a/ncurses/tinfo/lib_print.c +++ b/ncurses/tinfo/lib_print.c @@ -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.27 2020/05/27 23:55:56 tom 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 _WIN32 (void) sleep(0); #endif free(mybuf);