X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Ftest_instr.c;h=6dd16eb31abb6d00a4ce6b0cfef780a7df7276d1;hp=b24f772e4293c55bbf5d429742b5cd9c352be58b;hb=1379ab3f6cc5b92256708ecc4129b57928d62cf4;hpb=772f879d17117c5b766022f28099e341ebea825b diff --git a/test/test_instr.c b/test/test_instr.c index b24f772e..6dd16eb3 100644 --- a/test/test_instr.c +++ b/test/test_instr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2007 Free Software Foundation, Inc. * + * Copyright (c) 2007-2010,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 * @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: test_instr.c,v 1.4 2007/07/21 19:38:04 tom Exp $ + * $Id: test_instr.c,v 1.9 2017/09/06 09:27:45 tom Exp $ * * Author: Thomas E Dickey * @@ -56,7 +56,7 @@ Quit(int ch) static void show_1st(WINDOW *win, int line, char *buffer) { - mvwaddstr(win, line, 5, buffer); + MvWAddStr(win, line, 5, buffer); } static void @@ -68,7 +68,7 @@ showmore(WINDOW *win, int line, char *buffer) } static int -test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin) +recursive_test(int level, char **argv, WINDOW *chrwin, WINDOW *strwin) { WINDOW *txtbox = 0; WINDOW *txtwin = 0; @@ -85,6 +85,7 @@ test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin) return FALSE; } + *buffer = '\0'; if (level > 1) { txtbox = newwin(LINES - BASE_Y, COLS - level, BASE_Y, level); box(txtbox, 0, 0); @@ -150,7 +151,7 @@ test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin) beep(); break; case 'w': - test_inchs(level + 1, argv, chrwin, strwin); + recursive_test(level + 1, argv, chrwin, strwin); if (txtbox != 0) { touchwin(txtbox); wnoutrefresh(txtbox); @@ -174,7 +175,7 @@ test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin) break; } - mvwprintw(chrwin, 0, 0, "line:"); + MvWPrintw(chrwin, 0, 0, "line:"); wclrtoeol(chrwin); if (txtwin != stdscr) { @@ -198,7 +199,7 @@ test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin) } wnoutrefresh(chrwin); - mvwprintw(strwin, 0, 0, "%4d:", limit); + MvWPrintw(strwin, 0, 0, "%4d:", limit); wclrtobot(strwin); if (txtwin != stdscr) { @@ -253,7 +254,7 @@ main(int argc, char *argv[]) chrwin = derwin(chrbox, 2, COLS - 2, 1, 1); strwin = derwin(chrbox, 2, COLS - 2, 3, 1); - test_inchs(1, argv, chrwin, strwin); + recursive_test(1, argv, chrwin, strwin); endwin(); ExitProgram(EXIT_SUCCESS);