summaryrefslogtreecommitdiffstats
path: root/src/Daemon
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-12-15 19:54:51 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2009-12-15 19:54:51 +0100
commit1e119f37b85b90c5a9a17fdcbc80625727b4ab66 (patch)
tree2eda8402810f7148304c3f7ee878b86c9dcb67c8 /src/Daemon
parent661875fe000fd0d8469ae20d587fa84624d7f262 (diff)
downloadabrt-1e119f37b85b90c5a9a17fdcbc80625727b4ab66.tar.gz
abrt-1e119f37b85b90c5a9a17fdcbc80625727b4ab66.tar.xz
abrt-1e119f37b85b90c5a9a17fdcbc80625727b4ab66.zip
fix all instances of atoi() usage
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'src/Daemon')
-rw-r--r--src/Daemon/Daemon.cpp6
-rw-r--r--src/Daemon/MiddleWare.cpp2
-rw-r--r--src/Daemon/PluginManager.cpp6
-rw-r--r--src/Daemon/Settings.cpp2
4 files changed, 8 insertions, 8 deletions
diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp
index 153363d5..db55f849 100644
--- a/src/Daemon/Daemon.cpp
+++ b/src/Daemon/Daemon.cpp
@@ -216,14 +216,14 @@ static int SetUpCron()
std::string sM = "";
sH = it_c->first.substr(0, pos);
- nH = atoi(sH.c_str());
+ nH = xatou(sH.c_str());
nH = nH > 23 ? 23 : nH;
nH = nH < 0 ? 0 : nH;
nM = nM > 59 ? 59 : nM;
nM = nM < 0 ? 0 : nM;
timeout += nH * 60 * 60;
sM = it_c->first.substr(pos + 1);
- nM = atoi(sM.c_str());
+ nM = xatou(sM.c_str());
timeout += nM * 60;
}
else
@@ -231,7 +231,7 @@ static int SetUpCron()
std::string sS = "";
sS = it_c->first;
- nS = atoi(sS.c_str());
+ nS = xatou(sS.c_str());
nS = nS <= 0 ? 1 : nS;
timeout = nS;
}
diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp
index eb60ce44..fd2e86bb 100644
--- a/src/Daemon/MiddleWare.cpp
+++ b/src/Daemon/MiddleWare.cpp
@@ -477,7 +477,7 @@ report_status_t Report(const map_crash_report_t& pCrashReport,
if (pUID != "")
{
- home = get_home_dir(atoi(pUID.c_str()));
+ home = get_home_dir(xatoi_u(pUID.c_str()));
if (home != "")
{
oldSettings = reporter->GetSettings();
diff --git a/src/Daemon/PluginManager.cpp b/src/Daemon/PluginManager.cpp
index 82f22e85..b6a8b154 100644
--- a/src/Daemon/PluginManager.cpp
+++ b/src/Daemon/PluginManager.cpp
@@ -391,7 +391,7 @@ void CPluginManager::SetPluginSettings(const char *pName,
return;
}
- std::string home = get_home_dir(atoi(pUID.c_str()));
+ std::string home = get_home_dir(xatoi_u(pUID.c_str()));
if (home == "")
{
return;
@@ -399,7 +399,7 @@ void CPluginManager::SetPluginSettings(const char *pName,
std::string confDir = home + "/.abrt";
std::string confPath = confDir + "/" + pName + "."PLUGINS_CONF_EXTENSION;
- uid_t uid = atoi(pUID.c_str());
+ uid_t uid = xatoi_u(pUID.c_str());
struct passwd* pw = getpwuid(uid);
gid_t gid = pw ? pw->pw_gid : uid;
@@ -461,7 +461,7 @@ map_plugin_settings_t CPluginManager::GetPluginSettings(const char *pName,
/*
if (abrt_plugin->second->GetType() == REPORTER)
{
- std::string home = get_home_dir(atoi(pUID.c_str()));
+ std::string home = get_home_dir(xatoi_u(pUID.c_str()));
if (home != "")
{
LoadPluginSettings(home + "/.abrt/" + pName + "."PLUGINS_CONF_EXTENSION, ret);
diff --git a/src/Daemon/Settings.cpp b/src/Daemon/Settings.cpp
index 327851f5..d89bebfd 100644
--- a/src/Daemon/Settings.cpp
+++ b/src/Daemon/Settings.cpp
@@ -176,7 +176,7 @@ static void ParseCommon()
it = s_mapSectionCommon.find("MaxCrashReportsSize");
if (it != end)
{
- g_settings_nMaxCrashReportsSize = atoi(it->second.c_str());
+ g_settings_nMaxCrashReportsSize = xatoi_u(it->second.c_str());
}
it = s_mapSectionCommon.find("ActionsAndReporters");
if (it != end)