]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/demo_panels.c
ncurses 5.6 - patch 20080705
[ncurses.git] / test / demo_panels.c
index 6ef699fc391d7671e03817f7bf043d8b2dd8cb20..396d76c60d0d985720b44a2927d68274c2941fbc 100755 (executable)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2007 Free Software Foundation, Inc.                        *
+ * Copyright (c) 2007,2008 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: demo_panels.c,v 1.28 2007/08/11 16:34:49 tom Exp $
+ * $Id: demo_panels.c,v 1.31 2008/07/05 23:13:47 tom Exp $
  *
  * Demonstrate a variety of functions from the panel library.
  */
@@ -205,7 +205,7 @@ mkpanel(short color, int rows, int cols, int tly, int tlx)
 {
     WINDOW *win;
     PANEL *pan = 0;
-    char *userdata = malloc(3);
+    char *userdata = typeMalloc(char, 3);
 
     if ((win = newwin(rows, cols, tly, tlx)) != 0) {
        keypad(win, TRUE);
@@ -244,6 +244,7 @@ my_remove_panel(PANEL ** pans, int which)
     }
 }
 
+#undef MIN
 #define MIN(a,b) ((a) < (b) ? (a) : (b))
 #define ABS(a)   ((a) < 0 ? -(a) : (a))
 
@@ -634,7 +635,7 @@ get_command(PANEL * px[MAX_PANELS + 1], char *buffer, int limit)
     if (log_in != 0) {
        if (fgets(buffer, limit - 3, log_in) != 0) {
            length = strlen(buffer);
-           while (length > 0 && isspace(buffer[length - 1]))
+           while (length > 0 && isspace(UChar(buffer[length - 1])))
                buffer[--length] = '\0';
            waddstr(win, buffer);
        } else {