diff options
Diffstat (limited to 'ACEXML/common/StrCharStream.cpp')
-rw-r--r-- | ACEXML/common/StrCharStream.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/ACEXML/common/StrCharStream.cpp b/ACEXML/common/StrCharStream.cpp index 046511407c2..9bfcc95072c 100644 --- a/ACEXML/common/StrCharStream.cpp +++ b/ACEXML/common/StrCharStream.cpp @@ -73,13 +73,10 @@ ACEXML_StrCharStream::determine_encoding (void) const ACEXML_Char* temp = ACEXML_Encoding::get_encoding (input); if (!temp) return -1; - if (ACE_OS::strcmp (temp, - ACEXML_Encoding::encoding_names_[ACEXML_Encoding::OTHER]) == 0) - return -1; else { this->encoding_ = ACE::strnew (temp); - ACE_DEBUG ((LM_DEBUG, "String's encoding is %s\n", this->encoding_)); + // ACE_DEBUG ((LM_DEBUG, "String's encoding is %s\n", this->encoding_)); } return 0; } @@ -96,23 +93,19 @@ ACEXML_StrCharStream::get (ACEXML_Char& ch) if (this->start_ != 0 && this->ptr_ != this->end_) { ch = *this->ptr_++; - return 0; } - return -1; } int -ACEXML_StrCharStream::read (ACEXML_Char *str, - size_t len) +ACEXML_StrCharStream::read (ACEXML_Char *str, size_t len) { if (this->start_ != 0 && this->ptr_ != this->end_) { - if ((int) len > this->end_ - this->ptr_) + if (len * sizeof (ACEXML_Char) > (size_t) (this->end_ - this->ptr_)) len = this->end_ - this->ptr_; - ACE_OS_String::strncpy (str, this->ptr_, len); this->ptr_ += len; return len; |