]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/newdemo.c
ncurses 6.0 - patch 20170513
[ncurses.git] / test / newdemo.c
index fef092f2470c37fc750eeee2705e3dff40675c1f..e056ecb7fd1f7143bd6dffd813cacf82149ba934 100644 (file)
@@ -2,7 +2,7 @@
  *  newdemo.c  -       A demo program using PDCurses. The program illustrate
  *                     the use of colours for text output.
  *
  *  newdemo.c  -       A demo program using PDCurses. The program illustrate
  *                     the use of colours for text output.
  *
- * $Id: newdemo.c,v 1.40 2013/04/27 19:46:53 tom Exp $
+ * $Id: newdemo.c,v 1.43 2016/09/10 21:25:53 tom Exp $
  */
 
 #include <test.priv.h>
  */
 
 #include <test.priv.h>
@@ -84,7 +84,7 @@ set_colors(WINDOW *win, int pair, int foreground, int background)
        if (pair > COLOR_PAIRS)
            pair = COLOR_PAIRS;
        init_pair((short) pair, (short) foreground, (short) background);
        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));
     }
 }
 
     }
 }
 
@@ -96,7 +96,7 @@ use_colors(WINDOW *win, int pair, chtype attrs)
            pair = COLOR_PAIRS;
        attrs |= (chtype) COLOR_PAIR(pair);
     }
            pair = COLOR_PAIRS;
        attrs |= (chtype) COLOR_PAIR(pair);
     }
-    (void) wattrset(win, (int) attrs);
+    (void) wattrset(win, AttrArg(attrs, 0));
     return attrs;
 }
 
     return attrs;
 }
 
@@ -299,11 +299,11 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
        message = messages[j = 0];
        i = 1;
        w = width - 2;
        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) {
        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)
            }
 
            if (i < w)