summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-07-04 23:09:50 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-07-04 23:09:50 +0000
commit26c339b4bdde61c440893de6a5b222281a352272 (patch)
treedbaf3ff9a40cdf59589d7f37a20175164485c5dd /libs/ardour
parentedb73dcd3a7a326aa577262cbc70bdc20677173e (diff)
use sscanf with the correct type conversion and not atoi/atol to load nframes_t and nframes64_t in locations and playhead position. NOTE: other similar bugs may exist elsewhere
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@5324 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/location.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/libs/ardour/location.cc b/libs/ardour/location.cc
index 103074511c..6bd10ca27a 100644
--- a/libs/ardour/location.cc
+++ b/libs/ardour/location.cc
@@ -375,15 +375,15 @@ Location::set_state (const XMLNode& node)
/* can't use set_start() here, because _end
may make the value of _start illegal.
*/
-
- _start = atoi (prop->value().c_str());
+
+ sscanf (prop->value().c_str(), "%" PRIu32, &_start);
if ((prop = node.property ("end")) == 0) {
error << _("XML node for Location has no end information") << endmsg;
return -1;
}
- _end = atoi (prop->value().c_str());
+ sscanf (prop->value().c_str(), "%" PRIu32, &_end);
if ((prop = node.property ("flags")) == 0) {
error << _("XML node for Location has no flags information") << endmsg;
@@ -403,19 +403,19 @@ Location::set_state (const XMLNode& node)
cd_node = *cd_iter;
if (cd_node->name() != "CD-Info") {
- continue;
+ continue;
}
if ((prop = cd_node->property ("name")) != 0) {
- cd_name = prop->value();
+ cd_name = prop->value();
} else {
- throw failed_constructor ();
+ throw failed_constructor ();
}
if ((prop = cd_node->property ("value")) != 0) {
- cd_value = prop->value();
+ cd_value = prop->value();
} else {
- throw failed_constructor ();
+ throw failed_constructor ();
}