* newdemo.c - A demo program using PDCurses. The program illustrate
* the use of colours for text output.
*
- * $Id: newdemo.c,v 1.39 2012/12/29 23:39:08 tom Exp $
+ * $Id: newdemo.c,v 1.43 2016/09/10 21:25:53 tom Exp $
*/
#include <test.priv.h>
/*
* Trap interrupt
*/
-static RETSIGTYPE
+static void
trap(int sig GCC_UNUSED)
{
endwin();
if (pair > COLOR_PAIRS)
pair = COLOR_PAIRS;
init_pair((short) pair, (short) foreground, (short) background);
- (void) wattrset(win, (int) COLOR_PAIR(pair));
+ (void) wattrset(win, AttrArg(COLOR_PAIR(pair), 0));
}
}
pair = COLOR_PAIRS;
attrs |= (chtype) COLOR_PAIR(pair);
}
- (void) wattrset(win, (int) attrs);
+ (void) wattrset(win, AttrArg(attrs, 0));
return attrs;
}
message = messages[j = 0];
i = 1;
w = width - 2;
- strcpy(buffer, message);
+ _nc_STRCPY(buffer, message, sizeof(buffer));
while (j < NMESSAGES) {
while ((int) strlen(buffer) < w) {
- strcat(buffer, " ... ");
- strcat(buffer, messages[++j % NMESSAGES]);
+ _nc_STRCAT(buffer, " ... ", sizeof(buffer));
+ _nc_STRCAT(buffer, messages[++j % NMESSAGES], sizeof(buffer));
}
if (i < w)