subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1616185 - in /subversion/trunk/subversion: libsvn_subr/win32_xlate.c libsvn_wc/workqueue.c
Date Wed, 06 Aug 2014 12:20:03 GMT
Author: stsp
Date: Wed Aug  6 12:20:03 2014
New Revision: 1616185

URL: http://svn.apache.org/r1616185
Log:
Eradicate atoi() calls. We're not in 1980 anymore.

* subversion/libsvn_subr/win32_xlate.c
  (get_page_id_from_name): Use svn_cstring_atoi().

* subversion/libsvn_wc/workqueue.c
  (svn_wc__wq_run): Use svn_cstring_atoi().

Modified:
    subversion/trunk/subversion/libsvn_subr/win32_xlate.c
    subversion/trunk/subversion/libsvn_wc/workqueue.c

Modified: subversion/trunk/subversion/libsvn_subr/win32_xlate.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/win32_xlate.c?rev=1616185&r1=1616184&r2=1616185&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/win32_xlate.c (original)
+++ subversion/trunk/subversion/libsvn_subr/win32_xlate.c Wed Aug  6 12:20:03 2014
@@ -116,7 +116,17 @@ get_page_id_from_name(UINT *page_id_p, c
   if ((page_name[0] == 'c' || page_name[0] == 'C')
       && (page_name[1] == 'p' || page_name[1] == 'P'))
     {
-      *page_id_p = atoi(page_name + 2);
+      int page_id;
+
+      err = svn_cstring_atoi(&page_id, page_name + 2);
+      if (err)
+        {
+          apr_status_t saved = err->apr_err;
+          svn_error_clear(err);
+          return saved;
+        }
+
+      *page_id_p = page_id;
       return APR_SUCCESS;
     }
 

Modified: subversion/trunk/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/workqueue.c?rev=1616185&r1=1616184&r2=1616185&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.c Wed Aug  6 12:20:03 2014
@@ -1489,8 +1489,11 @@ svn_wc__wq_run(svn_wc__db_t *db,
   {
     static int count = 0;
     const char *count_env_var = getenv("SVN_DEBUG_WORK_QUEUE");
+    int count_env_val;
 
-    if (count_env_var && ++count == atoi(count_env_var))
+    SVN_ERR(svn_cstring_atoi(&count_env_val, count_env_var));
+
+    if (count_env_var && ++count == count_env_val)
       return svn_error_create(SVN_ERR_CANCELLED, NULL, "fake cancel");
   }
 #endif



Mime
View raw message