From mboxrd@z Thu Jan 1 00:00:00 1970 From: theonetruekenny@yahoo.com To: gcc-gnats@gcc.gnu.org Cc: kenny.simpson@gs.com Subject: libstdc++/3141: DR 243: basic_istream::get and getline when sentry reports failure Date: Tue, 12 Jun 2001 10:26:00 -0000 Message-id: <20010612171941.25791.qmail@sourceware.cygnus.com> X-SW-Source: 2001-06/msg00486.html List-Id: >Number: 3141 >Category: libstdc++ >Synopsis: DR 243: basic_istream::get and getline when sentry reports failure >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Tue Jun 12 10:26:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: theonetruekenny@yahoo.com >Release: 20010612 cvs >Organization: >Environment: source >Description: see http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#243 >How-To-Repeat: observe istream::get(char_type* __s, streamsize __n, char_type __delim) in line 536 of include/bits/istream.tcc note that on line 573: *__s = char_type(NULL); observe istream::getline(char_type* __s, streamsize __n, char_type __delim) in line 627 of include/bits/istream.tcc note on line 673: *__s = char_type(NULL); >Fix: as per DR 243, i.e.: before the sentry construction in both the functions, add: if( __n ) *s == char_type(); // same as charT() as specified in the DR 243 change the existing *__s = char_type(NULL)'s in 573/673 to *s == char_type(); and move then inside the body of the if's on lines 540 and 631. The condition in the if() on line 631 should be changed to match that of the if() on line 540. >Release-Note: >Audit-Trail: >Unformatted: