From 1e119f37b85b90c5a9a17fdcbc80625727b4ab66 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 15 Dec 2009 19:54:51 +0100 Subject: fix all instances of atoi() usage Signed-off-by: Denys Vlasenko --- lib/Plugins/Catcut.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/Plugins/Catcut.cpp') diff --git a/lib/Plugins/Catcut.cpp b/lib/Plugins/Catcut.cpp index ebddfdd..35f56f2 100644 --- a/lib/Plugins/Catcut.cpp +++ b/lib/Plugins/Catcut.cpp @@ -510,12 +510,12 @@ void CReporterCatcut::SetSettings(const map_plugin_settings_t& pSettings) it = pSettings.find("RetryCount"); if (it != end) { - m_nRetryCount = atoi(it->second.c_str()); + m_nRetryCount = xatoi_u(it->second.c_str()); } it = pSettings.find("RetryDelay"); if (it != end) { - m_nRetryDelay = atoi(it->second.c_str()); + m_nRetryDelay = xatoi_u(it->second.c_str()); } } -- cgit From 707f64b85c8a1b88923617ff72bd8a4ca562f3bd Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 16 Dec 2009 15:09:55 +0100 Subject: prevent destructors from throwing exceptions; check curl_easy_init errors Signed-off-by: Denys Vlasenko --- lib/Plugins/Catcut.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'lib/Plugins/Catcut.cpp') diff --git a/lib/Plugins/Catcut.cpp b/lib/Plugins/Catcut.cpp index 35f56f2..a56015d 100644 --- a/lib/Plugins/Catcut.cpp +++ b/lib/Plugins/Catcut.cpp @@ -1,6 +1,3 @@ -#include -#include -#include #include "abrtlib.h" #include "abrt_xmlrpc.h" #include "Catcut.h" @@ -18,11 +15,7 @@ using namespace std; static int put_stream(const char *pURL, FILE* f, size_t content_length) { - CURL* curl = curl_easy_init(); - if (!curl) - { - throw CABRTException(EXCEP_PLUGIN, "put_stream: can't initialize curl library"); - } + CURL* curl = xcurl_easy_init(); /* enable uploading */ curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); /* specify target */ -- cgit