/****************************************************************************
- * Copyright (c) 2006 Free Software Foundation, Inc. *
+ * Copyright (c) 2006-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 *
* authorization. *
****************************************************************************/
/*
- * $Id: echochar.c,v 1.3 2006/12/03 00:14:29 tom Exp $
+ * $Id: echochar.c,v 1.6 2008/04/12 22:06:04 tom Exp $
*
* Demonstrate the echochar function (compare to dots.c).
* Thomas Dickey - 2006/11/4
int last_fg = 0;
int last_bg = 0;
- while ((ch = getopt(argc, argv, "r")) != EOF) {
+ while ((ch = getopt(argc, argv, "r")) != -1) {
switch (ch) {
case 'r':
opt_r = TRUE;
if (use_colors) {
start_color();
if (COLOR_PAIRS > 0) {
- my_pairs = calloc(COLOR_PAIRS, sizeof(*my_pairs));
+ my_pairs = typeCalloc(char, COLOR_PAIRS);
}
use_colors = (my_pairs != 0);
}
}
}
if (opt_r) {
- addch(p);
+ addch(UChar(p));
refresh();
} else {
- echochar(p);
+ echochar(UChar(p));
}
++total_chars;
}