Re: memcmp() checker: memory access errors





On Mon, 18 Dec 2006, kolmogolov@xxxxxxxxx wrote:

<snipped>

BTW. I do ungetc() all 256 bytes in data[] back to the stream
for decoupling the probe_img() from all the other functions
for parsing the details of the headers. I thought tha it were s
a proper size for probing many kinds of my image files.



Be careful, because ungetc() can fail to push back the bytes to the input stream. The standard guarantees that only one push back can succeed without an intervening read or file positioning function (in which case your pushed back characters will be be discarded).

Emil
.



Relevant Pages

  • Mail::Thread, From headers incorrect?
    ... I believe the "from" headers of today's email are not the same the module ... sub slurp_messages { ... open FH, $mbox or return; ... push @messages, $mail; ...
    (comp.lang.perl.misc)
  • Chokerbitch
    ... :) Nah, tha boy did good. ... was so nearly there...just couldn't push it home. ... Shame. ... a reassuring amount of kekness from Nadal on hardcourt. ...
    (rec.sport.tennis)
  • Re: [SLE] Flac to OGG conversion?
    ... release the mouse button and push the middle mouse ... Check the headers for your unsubscription address ... Also check the archives at http://lists.suse.com ...
    (SuSE)
  • Re: [RFC] Move InfiniBand .h files
    ... > I would like to get people's reactions to moving the InfiniBand .h ... > push this change as soon as 2.6.14 starts. ... private headers for your subsystem. ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)