summaryrefslogtreecommitdiff
path: root/ACEXML/compass/PropertyFile_Handler.cpp
diff options
context:
space:
mode:
authorkitty <kitty@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-02-26 02:58:51 +0000
committerkitty <kitty@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-02-26 02:58:51 +0000
commitaef782d30e2a570e8dd831e1ae5c3e3e60d11b0f (patch)
tree9a99270a9d6ddc9c3ec470c286aa977dacb5252a /ACEXML/compass/PropertyFile_Handler.cpp
parentc0b7cb38e02d59fcac1cda1e0fe783ceeb8795fd (diff)
downloadATCD-aef782d30e2a570e8dd831e1ae5c3e3e60d11b0f.tar.gz
Misc. Fixes.
Diffstat (limited to 'ACEXML/compass/PropertyFile_Handler.cpp')
-rw-r--r--ACEXML/compass/PropertyFile_Handler.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/ACEXML/compass/PropertyFile_Handler.cpp b/ACEXML/compass/PropertyFile_Handler.cpp
index f95b6d4955f..12b98fa594a 100644
--- a/ACEXML/compass/PropertyFile_Handler.cpp
+++ b/ACEXML/compass/PropertyFile_Handler.cpp
@@ -11,6 +11,8 @@
static const ACEXML_Char empty_string[] = {0};
+extern int errno;
+
ACEXML_PropertyFile_Handler::ACEXML_PropertyFile_Handler (const ACEXML_Char* filename)
: fileName_(ACE::strnew (filename)), locator_ (0), property_ (0)
{
@@ -90,12 +92,20 @@ ACEXML_PropertyFile_Handler::endElement (const ACEXML_Char *,
}
else if (this->atttype_ == "long")
{
- int save_errno = errno;
+ errno = 0;
long value = ACE_OS::strtol (this->value_.c_str(), 0, 10);
- if (errno != save_errno ||
- this->property_->set (this->attname_, value) != 0)
+ if (errno != 0)
+ {
+ ACE_ERROR ((LM_ERROR, "Property %s = %d invalid: %m\n",
+ this->attname_.c_str(), value));
+ ACEXML_SAXParseException* exception = 0;
+ ACE_NEW_NORETURN (exception,
+ ACEXML_SAXParseException ("Invalid Property"));
+ ACEXML_ENV_RAISE (exception);
+ }
+ else if (this->property_->set (this->attname_, value) != 0)
{
- ACE_ERROR ((LM_ERROR, "Property %s = %ld invalid: %m\n",
+ ACE_ERROR ((LM_ERROR, "Property %s = %d invalid\n",
this->attname_.c_str(), value));
ACEXML_SAXParseException* exception = 0;
ACE_NEW_NORETURN (exception,