X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fditto.c;h=bf14946ff384a3450206bbd4ed426ec30cb87ad2;hp=627cf84e5ad7e95d5f9bf00aee70cf0ec6a81ffc;hb=5d8dbcdd9423bf9821db414fd9ec792ccf1f1027;hpb=445bfe6a0fb691e3433d586a188be2ebe062384b diff --git a/test/ditto.c b/test/ditto.c index 627cf84e..bf14946f 100644 --- a/test/ditto.c +++ b/test/ditto.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2012,2016 Free Software Foundation, Inc. * + * Copyright (c) 1998-2016,2017 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 * @@ -29,7 +29,7 @@ /* * Author: Thomas E. Dickey (1998-on) * - * $Id: ditto.c,v 1.43 2016/02/06 21:19:28 tom Exp $ + * $Id: ditto.c,v 1.46 2017/09/06 09:19:14 tom Exp $ * * The program illustrates how to set up multiple screens from a single * program. @@ -44,6 +44,8 @@ #include #include +#if HAVE_DELSCREEN + #ifdef USE_PTHREADS #include #endif @@ -167,7 +169,8 @@ open_tty(char *path) errno = EISDIR; failed(slave_name); } - sprintf(s_option, "-S%s/%d", slave_name, aslave); + _nc_SPRINTF(s_option, _nc_SLIMIT(sizeof(s_option)) + "-S%s/%d", slave_name, aslave); if (fork()) { execlp(xterm_prog, xterm_prog, s_option, "-title", path, (char *) 0); _exit(0); @@ -449,3 +452,11 @@ main(int argc, char *argv[]) } ExitProgram(EXIT_SUCCESS); } +#else +int +main(void) +{ + printf("This program requires the curses delscreen function\n"); + ExitProgram(EXIT_FAILURE); +} +#endif