From: Baptiste L. <bl...@us...> - 2006-02-11 21:15:39
|
Update of /cvsroot/jsoncpp/jsoncpp/src/lib_json In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3166/src/lib_json Modified Files: json_value.cpp Log Message: Report bug fixes found when working with cppunit2. Index: json_value.cpp =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/src/lib_json/json_value.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** json_value.cpp 31 Oct 2005 17:30:10 -0000 1.6 --- json_value.cpp 11 Feb 2006 21:15:30 -0000 1.7 *************** *** 36,40 **** if ( comment_ ) free( comment_ ); ! comment_ = strdup( text ); } --- 36,40 ---- if ( comment_ ) free( comment_ ); ! comment_ = text ? strdup( text ) : 0; } *************** *** 57,62 **** Value::CZString::CZString( const CZString &other ) ! : cstr_( other.index_ != noDuplication ? strdup( other.cstr_ ) ! : other.cstr_ ) , index_( other.cstr_ ? (other.index_ == noDuplication ? noDuplication : duplicate) : other.index_ ) --- 57,62 ---- Value::CZString::CZString( const CZString &other ) ! : cstr_( other.index_ != noDuplication && other.cstr_ != 0 ? strdup( other.cstr_ ) ! : other.cstr_ ) , index_( other.cstr_ ? (other.index_ == noDuplication ? noDuplication : duplicate) : other.index_ ) *************** *** 216,220 **** break; case stringValue: ! value_.string_ = strdup( other.value_.string_ ); break; case arrayValue: --- 216,223 ---- break; case stringValue: ! if ( other.value_.string_ ) ! value_.string_ = strdup( other.value_.string_ ); ! else ! value_.string_ = 0; break; case arrayValue: |