From: Ralph Corderoy Date: Sat, 22 Apr 2017 00:00:29 +0000 (+0100) Subject: sbr/discard.c: Simplify by inverting initial test. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/6a26499beca5a61354b6cc12e4abf6b7454ff878?ds=sidebyside sbr/discard.c: Simplify by inverting initial test. The function used to return early, but these days that's just avoiding a single statement, so execute that conditionally instead. --- diff --git a/sbr/discard.c b/sbr/discard.c index 83b0bfbc..7f65affc 100644 --- a/sbr/discard.c +++ b/sbr/discard.c @@ -1,4 +1,3 @@ - /* * discard.c -- discard output on a file pointer * @@ -11,16 +10,9 @@ #include - void discard (FILE *io) { - if (io == NULL) - return; - - tcflush (fileno(io), TCOFLUSH); - - /* There used to be an fpurge() here on some platforms, stdio - hackery on others. But it didn't seem necessary. */ + if (io) + tcflush (fileno(io), TCOFLUSH); } -