X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Ftestcurs.c;h=8310f3f855915b4ef73d3d3d74801fc5f7ffb3c5;hp=f9716e971bcbe19c5ffb4a3d06ece0d3296690f2;hb=1c551ea75ea57f9186fbe8d79674ac85baa4d358;hpb=b6d0d9ad9e372e856f01a4c283cf784a15993903 diff --git a/test/testcurs.c b/test/testcurs.c index f9716e97..8310f3f8 100644 --- a/test/testcurs.c +++ b/test/testcurs.c @@ -6,7 +6,7 @@ * wrs(5/28/93) -- modified to be consistent (perform identically) with either * PDCurses or under Unix System V, R4 * - * $Id: testcurs.c,v 1.44 2012/06/09 19:10:45 tom Exp $ + * $Id: testcurs.c,v 1.46 2012/11/24 19:38:20 tom Exp $ */ #include @@ -45,18 +45,6 @@ static const COMMAND command[] = }; #define MAX_OPTIONS (int) SIZEOF(command) -#if !HAVE_STRDUP -#define strdup my_strdup -static char * -strdup(char *s) -{ - char *p = typeMalloc(char, strlen(s) + 1); - if (p) - strcpy(p, s); - return (p); -} -#endif /* not HAVE_STRDUP */ - static int width, height; int @@ -693,9 +681,11 @@ padTest(WINDOW *dummy GCC_UNUSED) raw(); wgetch(pad); - spad = subpad(pad, 12, 25, 6, 52); - MvWAddStr(spad, 2, 2, "This is a new subpad"); - box(spad, 0, 0); + if ((spad = subpad(pad, 12, 25, 6, 52)) != 0) { + MvWAddStr(spad, 2, 2, "This is a new subpad"); + box(spad, 0, 0); + delwin(spad); + } prefresh(pad, 0, 0, 0, 0, 15, 75); keypad(pad, TRUE); raw();