[Debian-astro-commits] [gyoto] 124/221: Use strtoul and strtol instead of atoi when parsing longs/unsigned longs from XML

Thibaut Jean-Claude Paumard thibaut at moszumanska.debian.org
Fri May 22 20:52:39 UTC 2015


This is an automated email from the git hooks/post-receive script.

thibaut pushed a commit to branch master
in repository gyoto.

commit f3e9aef11264e4c141a05aba8acc9fb4284ccc75
Author: Thibaut Paumard <paumard at users.sourceforge.net>
Date:   Tue Dec 2 15:19:23 2014 +0100

    Use strtoul and strtol instead of atoi when parsing longs/unsigned longs from XML
---
 lib/Object.C | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/Object.C b/lib/Object.C
index a182980..a0c7871 100644
--- a/lib/Object.C
+++ b/lib/Object.C
@@ -7,6 +7,7 @@
 #include "GyotoSpectrum.h"
 
 #include <iostream>
+#include <cstdlib>
 
 using namespace std ;
 using namespace Gyoto ;
@@ -250,10 +251,10 @@ void Object::setParameter(Property const &p, string const &name,
     val = (name==p.name);
     break;
   case Property::long_t:
-    val = long(atoi(content.c_str()));
+    val = strtol(content.c_str(), NULL, 0);
     break;
   case Property::unsigned_long_t:
-    val = (unsigned long)(atoi(content.c_str()));
+    val = strtoul(content.c_str(), NULL, 0);
     break;
   case Property::double_t:
     val = atof(content.c_str());

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-astro/packages/gyoto.git



More information about the Debian-astro-commits mailing list