X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fdots_mvcur.c;h=611964c1eae823279eb412acefcba70218179970;hp=0d8aafba4d0a13642eb45c66a471777163006a4f;hb=8c0ecb76c78517e32c606dadf87b5f31f24b78fe;hpb=3853a8e97d7efa8cb6a3c93c696d2c52895d6a70 diff --git a/test/dots_mvcur.c b/test/dots_mvcur.c index 0d8aafba..611964c1 100644 --- a/test/dots_mvcur.c +++ b/test/dots_mvcur.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 2007-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,7 +29,7 @@ /* * Author: Thomas E. Dickey - 2007 * - * $Id: dots_mvcur.c,v 1.1 2007/06/02 20:01:32 tom Exp $ + * $Id: dots_mvcur.c,v 1.4 2009/10/10 16:14:24 tom Exp $ * * A simple demo of the terminfo interface, and mvcur. */ @@ -47,15 +47,19 @@ 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); + if (putc(c, stdout) == EOF) + rc = EOF; } - return 0; + return rc; } static bool