turboc and fgets

John Core johncore at compnect.UUCP
Wed Jul 11 01:40:32 AEST 1990


while using fgets with turbo C on Ms-dos I get the following problem:
	when reading a char *str with fgets the manual says that
	fgets will stop at num-1 characters or if a read character
	is a newline.

	char	*fgets(str,num,stream)
	
	I have never had problems with fgets on Unix SYSV but under
	TURBOC   ON THE SAME FILE   fgets does not always find the
	newline marker, the operation is at times unpredictable.
	since it seems to miss the newline char it the continues to
	read the following lines in the file untill the num-1 is
	satisfied.

Has anyone else had experience with this problem. If you can help or
al least tell me I am doing something wrong, or that it is a bug
Thanks in advance



Wizard Systems              |    UUCP:   uunet!wa3wbu!compnect!johncore
P.O. Box 6269               |INTERNET:   johncore at compnect.wa3wbu
Harrisburg, Pa. 17112-6269  |a public bbs since 1978. Data(717)657-4992 & 4997
John Core, SYSOP            |-------------------------------------------------
----------------------------| No matter where you go, there you are!
a woman is just a woman, but a good cigar is a smoke.   -R. Kipling


	



More information about the Comp.lang.c mailing list