- pad = newpad(50, 100);
- wattron(pad, A_REVERSE);
- mvwaddstr(pad, 5, 2, "This is a new pad");
- wattrset(pad, A_NORMAL);
- mvwaddstr(pad, 8, 0,
- "The end of this line should be truncated here:except now");
- mvwaddstr(pad, 11, 1, "This line should not appear.It will now");
- wmove(pad, 10, 1);
- wclrtoeol(pad);
- mvwaddstr(pad, 10, 1, " Press any key to continue");
- prefresh(pad, 0, 0, 0, 0, 10, 45);
- keypad(pad, TRUE);
- raw();
- wgetch(pad);
+ if ((pad = newpad(50, 100)) != 0) {
+ wattron(pad, A_REVERSE);
+ MvWAddStr(pad, 5, 2, "This is a new pad");
+ (void) wattrset(pad, A_NORMAL);
+ MvWAddStr(pad, 8, 0,
+ "The end of this line should be truncated here:except now");
+ MvWAddStr(pad, 11, 1, "This line should not appear.It will now");
+ wmove(pad, 10, 1);
+ wclrtoeol(pad);
+ MvWAddStr(pad, 10, 1, " Press any key to continue");
+ prefresh(pad, 0, 0, 0, 0, 10, 45);
+ keypad(pad, TRUE);
+ raw();
+ wgetch(pad);