Bug 000281

When Created: 04/22/1999 12:00:49
Against DJGPP version: 2.02
By whom:
Abstract: Non standard behavior of istrstream(const char *)
In The Draft Standard C++ Library by P.J. Plauger, he states

"For a null-terminated string s, you can write:
istrstream strin(s);
The character sequence begins at s and continues up to,
but not including,
the terminating null character that follows."

From my experiments, it seems as though the terminating
null character IS included in strin. Of course, this
book is based on a draft copy of the standard and I
believe that strstream is actually not in the
standard anymore, so this may all be moot.

Workaround added: 04/22/1999 12:00:37
By whom:
Obvious work around is to either to use
istrstream strin(s, strlen(s)); // Or some variant.
or just simply check for that null before
doing a check for strin.eof().

Note added: 04/22/1999 12:00:28
By whom:
I was wrong about the null value being added to the end of istream. It is something, but not always 0, so probably has nothing to do with that.

Note added: 06/03/1999 03:00:34
By whom:
If at all, this is a bug in libstdc++, not in DJGPP.

Closed on 06/03/1999 03:00:56: Not a DJGPP bug.
By whom:

  webmaster     delorie software   privacy  
  Copyright 2010   by DJ Delorie     Updated Jul 2010