Author: wyoung
Date: Wed Jul 11 23:22:10 2007
New Revision: 1665

URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1665&view=rev
Log:
Tacking a trailing null onto the end of a const_string when copied from
a C++ string, just in case.  It's not counted as part of the length,
just there for paranoia reasons.

Modified:
    trunk/lib/const_string.h

Modified: trunk/lib/const_string.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/const_string.h?rev=1665&r1=1664&r2=1665&view=diff
==============================================================================
--- trunk/lib/const_string.h (original)
+++ trunk/lib/const_string.h Wed Jul 11 23:22:10 2007
@@ -87,8 +87,9 @@
        str_data_(0),
        length_(str.length())
        {
-               str_data_ = new char[length_];
+               str_data_ = new char[length_ + 1];
                memcpy(str_data_, str.data(), length_);
+               str_data_[length_] = '\0';
        }
        
        /// \brief Initialize string from existing C string


_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits

Reply via email to