From cd62a92d4a964bfe61d35ba2301b69e65e22a509 Mon Sep 17 00:00:00 2001 From: Robert Mustacchi Date: Mon, 2 Mar 2020 05:43:45 +0000 Subject: 7092 Want support for stdio memory streams 12360 fwrite can loop forever on zero byte write 12392 ftello64 doesn't handle ungetc() correctly when unbuffered Reviewed by: John Levon Reviewed by: Yuri Pankov Approved by: Dan McDonald --- usr/src/lib/libc/port/stdio/doscan.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'usr/src/lib/libc/port/stdio/doscan.c') diff --git a/usr/src/lib/libc/port/stdio/doscan.c b/usr/src/lib/libc/port/stdio/doscan.c index e375d9824f..fda4d5c2ea 100644 --- a/usr/src/lib/libc/port/stdio/doscan.c +++ b/usr/src/lib/libc/port/stdio/doscan.c @@ -25,9 +25,7 @@ */ /* Copyright (c) 1988 AT&T */ -/* All Rights Reserved */ - -#pragma ident "%Z%%M% %I% %E% SMI" +/* All Rights Reserved */ #include "lint.h" #include @@ -402,7 +400,7 @@ charswitch: /* target of a goto 8-( */ if (size == 'l') { int c, len, i; int negflg = 0; - unsigned char *p; + unsigned char *p; p = (unsigned char *)(fmt - 1); len = 0; @@ -830,10 +828,10 @@ readchar(FILE *iop, int *chcount) int inchar; char buf[1]; - if ((iop->_flag & _IOWRT) || (iop->_cnt != 0)) + if ((iop->_flag & _IOWRT) || (iop->_cnt != 0)) { inchar = locgetc((*chcount)); - else { - if (read(FILENO(iop), buf, 1) != 1) + } else { + if (_xread(iop, buf, 1) != 1) return (EOF); inchar = (int)buf[0]; (*chcount) += 1; -- cgit v1.2.3