From 6a26499beca5a61354b6cc12e4abf6b7454ff878 Mon Sep 17 00:00:00 2001 From: Ralph Corderoy Date: Sat, 22 Apr 2017 01:00:29 +0100 Subject: [PATCH] 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. --- sbr/discard.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) 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); } - -- 2.56.0