From: Jim Meyering Date: Sun, 5 Dec 2004 18:52:33 +0000 (+0000) Subject: Include . X-Git-Tag: v5.3.0~212 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=210212143b6cbafa886e24ae6a3c1723870cb2e3;p=thirdparty%2Fcoreutils.git Include . (__fpending): Abort if PENDING_OUTPUT_N_BYTES is negative. This ensures that if there is an error in the definition of the PENDING_OUTPUT_N_BYTES expression, we'll find about it right away; this value is used only in the rare event that close_stdout's fclose fails with EBADF. --- diff --git a/lib/__fpending.c b/lib/__fpending.c index 007302c8c4..c2405cd63b 100644 --- a/lib/__fpending.c +++ b/lib/__fpending.c @@ -21,6 +21,8 @@ # include #endif +#include + #include "__fpending.h" /* Return the number of pending (aka buffered, unflushed) @@ -28,5 +30,8 @@ size_t __fpending (FILE *fp) { - return PENDING_OUTPUT_N_BYTES; + ptrdiff_t n = PENDING_OUTPUT_N_BYTES; + if (n < 0) + abort (); + return n; }