This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/1996] open_memstream() and seek past end of buffer


------- Additional Comments From michael dot kerrisk at gmx dot net  2006-04-24 23:06 -------
Subject: Re:  open_memstream() and seek past end of buffer

Hi Ryan,

> Your call:
> 
> l = fseek(output, 50, SEEK_END);
> 
> is failing with l == -1, but there is no errno being set.  I'm taking a
> look at the fseek() function.  I think it is returning from CHECK_FILE()
> with -1 and no errno.  This is probably because you're trying to seek to
> the end of an empty stream at this point.  I'll investigate more.

I'm not quite sure what you mean by its "my call".  Yes, fseek() is 
failing with errno not set, but the point is that *according to the 
documentation* I should be able to successfully perform move to some point 
past the endd of stream:

     You can move the stream's file position with `fseek' or `fseeko'
     (*note File Positioning::).  Moving the file position past the end
     of the data already written fills the intervening space with
     zeroes.

Cheers,

Michael



-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=1996

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]