Léa Massiot wrote:
> As you can see, the value of the environment variable 
> "CONTENT_LENGTH"
> differs from the value of the variable "i" at the end of 
> the loop.

Assuming that the correct value of content length is being 
reported, variable i seems to be getting set to EOF too 
early.

Now, getchar() returns EOF at the end of the file *or on 
error*. You should be able to use feof(stdin)  and 
ferror(stdin) to distinguish between these two cases. If 
it's an error, errno may tell you more.

David

Reply via email to