bug-cgicc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: a bug in function writeString.


From: Stephen F. Booth
Subject: RE: a bug in function writeString.
Date: Sun, 2 Sep 2001 17:12:29 -0400

Hi Gilbert,

That bug has been fixed and committed to CVS.  The next release of cgicc
will be 3.2 which will occur hopefully sometime in September.  The major
change will be relicensing from the GPL to the LGPL.

Thanks for the bug report.

-Stephen

>      Because string::data() returns a 'const char *' that not
> necessarily null-terminated. Using ostream::operator<< is wrong.
>      I found this bug when I uploaded a binary file and saved the request
> to a file.
>
>      This is the code for writeString that is right for me.
> ==========================================
> void
> CGICCNS writeString(STDNS ostream& out,
>                     const STDNS string& s)
> {
>   out << s.length() << ' ';
>   out.write(s.data(), s.length());
> }
> ==========================================




reply via email to

[Prev in Thread] Current Thread [Next in Thread]