Commit 1d6e9ab9 authored by Pavel Vainerman's avatar Pavel Vainerman

(UniXML): исправил ошибку в функции getPIntProp() для отрицательных чисел и нуля.

parent 5131dc5a
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
Name: libuniset Name: libuniset
Version: 1.7 Version: 1.7
Release: alt15 Release: alt16
Summary: UniSet - library for building distributed industrial control systems Summary: UniSet - library for building distributed industrial control systems
...@@ -335,6 +335,9 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname ...@@ -335,6 +335,9 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
%exclude %_pkgconfigdir/libUniSet.pc %exclude %_pkgconfigdir/libUniSet.pc
%changelog %changelog
* Mon Oct 20 2014 Pavel Vainerman <pv@altlinux.ru> 1.7-alt16
- fixed bug in UniXML::iteartor getPIntProp() for prop <= 0
* Sun Jun 22 2014 Pavel Vainerman <pv@altlinux.ru> 1.7-alt15 * Sun Jun 22 2014 Pavel Vainerman <pv@altlinux.ru> 1.7-alt15
- optimization: add insert-buffer for DBServer_MySQL (see uniset-docs) - optimization: add insert-buffer for DBServer_MySQL (see uniset-docs)
......
...@@ -133,7 +133,7 @@ int UniXML::getIntProp(const xmlNode* node, const string name ) ...@@ -133,7 +133,7 @@ int UniXML::getIntProp(const xmlNode* node, const string name )
int UniXML::getPIntProp(const xmlNode* node, const string name, int def ) int UniXML::getPIntProp(const xmlNode* node, const string name, int def )
{ {
string param = getProp(node,name); string param( getProp(node,name) );
if( param.empty() ) if( param.empty() )
return def; return def;
...@@ -407,10 +407,11 @@ int UniXML_iterator::getIntProp( const string name ) const ...@@ -407,10 +407,11 @@ int UniXML_iterator::getIntProp( const string name ) const
int UniXML_iterator::getPIntProp( const string name, int def ) const int UniXML_iterator::getPIntProp( const string name, int def ) const
{ {
int i = getIntProp(name); string param( getProp(name) );
if (i <= 0) if( param.empty() )
return def; return def;
return i;
return UniSetTypes::uni_atoi(param);
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment