From: "smahapatra_ct@yahoo.com" <smahapatra_ct@yahoo.com>
To: 9fans@cse.psu.edu
Subject: [9fans] bungetc error
Date: Wed, 2 Jan 2008 11:00:26 +0000 [thread overview]
Message-ID: <16287bc4-e635-4d1d-9ede-2f3f02c8e8ae@f52g2000hsa.googlegroups.com> (raw)
I think after bgetc returns Beof, bungetc should change the state, but
not decrement bp->icount.
The correct code should be:
int
Bungetc(Biobufhdr *bp)
{
if(bp->state != Bractive) {
if (bp->state == Bracteof)
bp->state = Bractive;
return Beof;
}
bp->icount--;
return 1;
}
instead of the current code:
int
Bungetc(Biobufhdr *bp)
{
if(bp->state == Bracteof)
bp->state = Bractive;
if(bp->state != Bractive)
return Beof;
bp->icount--;
return 1;
}
Regards,
Saroj Mahapatra
next reply other threads:[~2008-01-02 11:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-02 11:00 smahapatra_ct [this message]
2008-01-02 21:51 ` Martin Neubauer
2008-01-03 0:24 ` Charles Forsyth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=16287bc4-e635-4d1d-9ede-2f3f02c8e8ae@f52g2000hsa.googlegroups.com \
--to=smahapatra_ct@yahoo.com \
--cc=9fans@cse.psu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).