about summary refs log tree commit diff
path: root/stdio
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-12-19 10:00:22 +0000
committerRoland McGrath <roland@gnu.org>1995-12-19 10:00:22 +0000
commit755f55b0dbb0ffadc0acf020123c727dcf558354 (patch)
tree4c827acefeb58a0b9b3c3def6390a364a951a9bf /stdio
parent8882961f3882ae110b9a1d5b78497c9a8f56ed0d (diff)
downloadglibc-755f55b0dbb0ffadc0acf020123c727dcf558354.tar.gz
glibc-755f55b0dbb0ffadc0acf020123c727dcf558354.tar.xz
glibc-755f55b0dbb0ffadc0acf020123c727dcf558354.zip
Mon Dec 18 13:40:37 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> cvs/libc-951219
	* stdio/fread.c: Don't increment __offset when it's -1.

	* elf/rtld.c (dl_main): Prepend tab to "statically linked".  Exit
	0 in that case.

	* misc/err.c (vwarnx, vwarn): Fix major brainos.

	* sysdeps/mach/hurd/dl-sysdep.c (mmap): Fix setting of
	inheritance.
Diffstat (limited to 'stdio')
-rw-r--r--stdio/fread.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/stdio/fread.c b/stdio/fread.c
index 347e8446e1..d2766f6616 100644
--- a/stdio/fread.c
+++ b/stdio/fread.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -95,8 +95,11 @@ DEFUN(fread, (p, size, nmemb, stream),
 	    if (count > 0)
 	      {
 		to_read -= count;
-		stream->__offset += count;
-		stream->__target += count;
+		if (stream->__offset != -1)
+		  {
+		    stream->__offset += count;
+		    stream->__target += count;
+		  }
 		ptr += count;
 	      }
 	    else if (count == 0)