diff options
author | Mark Spruiell <mes@zeroc.com> | 2002-02-12 21:59:12 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2002-02-12 21:59:12 +0000 |
commit | 36ae541052b61d71780edce8aa8f4aa100458ed1 (patch) | |
tree | 2bf6a1ae2737f37be9bd077c1cbbd6fe620ef514 /cpp/src/IceXML/StreamI.cpp | |
parent | adding collocated support (diff) | |
download | ice-36ae541052b61d71780edce8aa8f4aa100458ed1.tar.bz2 ice-36ae541052b61d71780edce8aa8f4aa100458ed1.tar.xz ice-36ae541052b61d71780edce8aa8f4aa100458ed1.zip |
minor fixes
Diffstat (limited to 'cpp/src/IceXML/StreamI.cpp')
-rw-r--r-- | cpp/src/IceXML/StreamI.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/cpp/src/IceXML/StreamI.cpp b/cpp/src/IceXML/StreamI.cpp index aef53a66721..cfbcab5b062 100644 --- a/cpp/src/IceXML/StreamI.cpp +++ b/cpp/src/IceXML/StreamI.cpp @@ -81,9 +81,9 @@ public: { ostringstream os; os << "xerces: file: \"" << toString(ex.getSystemId()) - << "\", line:" << ex.getLineNumber() + << "\", line: " << ex.getLineNumber() << ", column: " << ex.getColumnNumber() - << "\n,essage: " << toString(ex.getMessage()) << endl; + << "\nmessage: " << toString(ex.getMessage()) << endl; _logger->warning(os.str()); } @@ -252,7 +252,7 @@ IceXML::StreamI::StreamI(const ::Ice::CommunicatorPtr& communicator, std::istrea // parser->setEntityResolver // - // Parse the XML file, catching any XML exceptions that might propogate + // Parse the XML file, catching any XML exceptions that might propagate // out of it. // bool errorsOccured = false; @@ -680,7 +680,12 @@ IceXML::StreamI::readShort(const string& name, ::Ice::Short& value) } string s = toString(child.getNodeValue()); - value = atoi(s.c_str()); + ::Ice::Int i = atoi(s.c_str()); + if (i < -32767 || i > 32768) + { + throw ::Ice::UnmarshalException(__FILE__, __LINE__); + } + value = (::Ice::Short)i; endRead(); } @@ -992,7 +997,7 @@ IceXML::StreamI::writeStringSeq(const string& name, const ::Ice::StringSeq& seq) startWrite(name); for (::Ice::StringSeq::const_iterator p = seq.begin(); p != seq.end(); ++p) { - _os << nl << "<e>" << *p << "</e>"; + _os << nl << "<e>" << *p << "</e>"; // TODO: Escape } endWrite(); } |