X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fdemo_new_pair.c;h=a4cbb5370dcbec8ba03fc7db13ba56dced2873c8;hp=4067c8817ad3532f43174415272233e90fdbb860;hb=119b5a6788c26bf7dcc99fcfd54e072946352a93;hpb=7fa7badf32c514211478cf9f79c70f20d435c2f2 diff --git a/test/demo_new_pair.c b/test/demo_new_pair.c index 4067c881..a4cbb537 100644 --- a/test/demo_new_pair.c +++ b/test/demo_new_pair.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2017 Free Software Foundation, Inc. * + * Copyright (c) 2017,2018 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_new_pair.c,v 1.18 2017/10/11 22:16:14 tom Exp $ + * $Id: demo_new_pair.c,v 1.19 2018/05/12 14:30:04 tom Exp $ * * Demonstrate the alloc_pair() function. */ @@ -223,7 +223,7 @@ main(int argc, char *argv[]) if (isatty(fileno(stderr))) { output = stderr; - } else if ((ch = open("/dev/tty", O_WRONLY)) != 0) { + } else if ((ch = open("/dev/tty", O_WRONLY)) >= 0) { output = fdopen(ch, "w"); } else { fprintf(stderr, "cannot open terminal for output\n");