X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fdots.c;h=57e334134ca3f009188fadc4deb913905c61af21;hp=c99fbf4dd7be3449af2eddc907257fc5dda39395;hb=59108c98bda25ae50b3a319e2bcb7f4b9a174024;hpb=027ae42953e3186daed8f3882da73de48291b606;ds=sidebyside diff --git a/test/dots.c b/test/dots.c index c99fbf4d..57e33413 100644 --- a/test/dots.c +++ b/test/dots.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999-2005,2006 Free Software Foundation, Inc. * + * Copyright (c) 1999-2008,2009 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 * @@ -29,10 +29,11 @@ /* * Author: Thomas E. Dickey 1999 * - * $Id: dots.c,v 1.15 2006/11/04 19:54:42 tom Exp $ + * $Id: dots.c,v 1.19 2009/10/10 16:22:24 tom Exp $ * * A simple demo of the terminfo interface. */ +#define USE_TINFO #include #if HAVE_SETUPTERM @@ -46,13 +47,16 @@ static long total_chars = 0; static time_t started; static int -outc(int c) +outc(TPUTS_ARG c) { + int rc = c; + if (interrupted) { - char tmp = c; - write(STDOUT_FILENO, &tmp, 1); + char tmp = (char) c; + if (write(STDOUT_FILENO, &tmp, 1) == -1) + rc = EOF; } else { - putc(c, stdout); + rc = putc(c, stdout); } return 0; }