public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: nick.wells@jobstats.co.uk To: gcc-gnats@gcc.gnu.org Subject: libstdc++/8874: using rdbuf to copy from an empty file sets the fail bit on the target stream Date: Sun, 08 Dec 2002 07:56:00 -0000 [thread overview] Message-ID: <20021208154706.28790.qmail@sources.redhat.com> (raw) >Number: 8874 >Category: libstdc++ >Synopsis: using rdbuf to copy from an empty file sets the fail bit on the target stream >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Sun Dec 08 07:56:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: Nick Wells >Release: gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7) >Organization: >Environment: Linux RedHat 8.0 i686 (Dell Precision 220) >Description: when you copy from an empty file using the os << fs.rdbuf() idiom the failbit is set on the output stream. See sample code. >How-To-Repeat: compile and run the program (I have used /etc/passwd as a 'good' file and /dev/null as a 'bad' file but any file would do. >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: application/octet-stream; name="rdbuf.C" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="rdbuf.C" I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8ZnN0cmVhbT4KI2luY2x1ZGUgPHN0cmluZz4K CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgoKdm9pZCBmKG9zdHJlYW0gJiB0bywgY29uc3QgY2hhciAq IGNvbnN0IGZpbGVuYW1lKQp7CiAgICBpZnN0cmVhbSBmcm9tKGZpbGVuYW1lKTsKICAgIGlmICgh IGZyb20pCWNlcnIgPDwgImNhbid0IG9wZW4gIiA8PCBmaWxlbmFtZSA8PCBlbmRsOwogICAgZWxz ZQoJdG8gPDwgZnJvbS5yZGJ1ZigpIDw8IGVuZGw7CgogICAgY2VyciA8PCAiZnJvbSA9ICIgPDwg ZmlsZW5hbWUgPDwgZW5kbDsKICAgIGNlcnIgPDwgInRvLmJhZGJpdCA9ICIgPDwgdG8uYmFkKCkg PDwgIiwgdG8uZW9mYml0ID0gIiA8PCB0by5lb2YoKSA8PCAiLCB0by5mYWlsYml0ID0gIiA8PCB0 by5mYWlsKCkgPDwgZW5kbDsKICAgIGNlcnIgPDwgImZyb20uYmFkYml0ID0gIiA8PCBmcm9tLmJh ZCgpIDw8ICIsIGZyb20uZW9mYml0ID0gIiA8PCBmcm9tLmVvZigpIDw8ICIsIGZyb20uZmFpbGJp dCA9ICIgPDwgZnJvbS5mYWlsKCkgPDwgZW5kbDsKfQoKbWFpbihpbnQgYXJnYywgY2hhciAqKiBh cmd2KQp7CiAgICBvZnN0cmVhbSB0bygiLi90ZXN0LnJkYnVmLm91dCIpOwogICAgCiAgICBmKHRv LCAiL2V0Yy9wYXNzd2QiKTsKICAgIGYodG8sICIvZGV2L251bGwiKTsKfQo=
next reply other threads:[~2002-12-08 15:56 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-12-08 7:56 nick.wells [this message] 2002-12-11 10:11 bkoz 2003-01-06 20:46 bkoz
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=20021208154706.28790.qmail@sources.redhat.com \ --to=nick.wells@jobstats.co.uk \ --cc=gcc-gnats@gcc.gnu.org \ /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: linkBe 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 read-only IMAP folder(s) and NNTP newsgroup(s).