From owner-cvs-all Fri Aug 31 13:52:30 2001 Delivered-To: cvs-all@freebsd.org Received: from cx281057-a.irvn1.occa.home.com (cx281057-a.irvn1.occa.home.com [24.1.175.22]) by hub.freebsd.org (Postfix) with ESMTP id 0410F37B401; Fri, 31 Aug 2001 13:52:26 -0700 (PDT) Received: from cx281057-a.irvn1.occa.home.com (localhost [127.0.0.1]) by cx281057-a.irvn1.occa.home.com (8.11.1/8.11.1) with ESMTP id f7VKql921866; Fri, 31 Aug 2001 13:52:49 -0700 (PDT) (envelope-from housel@acm.org) Date: Fri, 31 Aug 2001 13:52:47 -0700 Message-ID: From: housel@acm.org (Peter S. Housel) To: "Andrey A. Chernov" Cc: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libc/stdio ftell.c ungetc.c In-Reply-To: <200108311950.f7VJoPd48683@freefall.freebsd.org> References: <200108311950.f7VJoPd48683@freefall.freebsd.org> User-Agent: Wanderlust/2.4.1 (Stand By Me) SEMI/1.13.7 (Awazu) FLIM/1.13.2 (Kasanui) Emacs/20.7 (i386--freebsd) MULE/4.0 (HANANOEN) MIME-Version: 1.0 (generated by SEMI 1.13.7 - "Awazu") Content-Type: text/plain; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At Fri, 31 Aug 2001 12:50:25 -0700 (PDT), Andrey A. Chernov wrote: > ache 2001/08/31 12:50:25 PDT > > Modified files: > lib/libc/stdio ftell.c ungetc.c > Log: > Disallow ungetc at offset 0 (to prevent negative offset happens), so simplify > checks in ftell. > > Revision Changes Path > 1.18 +12 -23 src/lib/libc/stdio/ftell.c > 1.10 +5 -1 src/lib/libc/stdio/ungetc.c Section 7.19.7.11 of ISO/IEC 9899:1999 says that one character of ungetc is guaranteed. It also says that the file position indicator value is indeterminate if was zero before the call. Section 7.26.9 says that pusing back characters at position 0 is an "obsolescent feature" that will probably go away in the next revision of the standard. But that doesn't mean you can disallow it now. -Peter- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message