]> diplodocus.org Git - nmh/commitdiff
sbr/discard.c: Simplify by inverting initial test.
authorRalph Corderoy <ralph@inputplus.co.uk>
Sat, 22 Apr 2017 00:00:29 +0000 (01:00 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Sat, 22 Apr 2017 00:00:29 +0000 (01:00 +0100)
The function used to return early, but these days that's just avoiding a
single statement, so execute that conditionally instead.

sbr/discard.c

index 83b0bfb..7f65aff 100644 (file)
@@ -1,4 +1,3 @@
-
 /*
  * discard.c -- discard output on a file pointer
  *
 
 #include <termios.h>
 
-
 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);
 }
-