X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fdemo_panels.c;h=2adc690e11c750ee02df97af51ff67c33056ebab;hp=8865f70ddff4a38b62e730e131b2d0b12648403a;hb=396a05943b7da5039dd15d79c4385c7d2a75d6d4;hpb=a6e4fdd3cdc7d71be239c8cae7bc2c2145619e60 diff --git a/test/demo_panels.c b/test/demo_panels.c index 8865f70d..2adc690e 100755 --- a/test/demo_panels.c +++ b/test/demo_panels.c @@ -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.26 2007/07/07 22:16:33 tom Exp $ + * $Id: demo_panels.c,v 1.30 2008/04/12 21:59:49 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); @@ -234,7 +234,7 @@ my_remove_panel(PANEL ** pans, int which) if (pans[which] != 0) { PANEL *pan = pans[which]; WINDOW *win = panel_window(pan); - char *user = panel_userptr(pan); + char *user = (char *) panel_userptr(pan); free(user); del_panel(pan); @@ -634,7 +634,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 { @@ -759,7 +759,7 @@ main(int argc, char *argv[]) setlocale(LC_ALL, ""); - while ((c = getopt(argc, argv, "i:o:mwx")) != EOF) { + while ((c = getopt(argc, argv, "i:o:mwx")) != -1) { switch (c) { case 'i': log_in = fopen(optarg, "r");