You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2015/03/18 11:13:13 UTC
svn commit: r1667477 - in /subversion/trunk:
subversion/svnrdump/load_editor.c tools/dev/fsfs-access-map.c
Author: julianfoad
Date: Wed Mar 18 10:13:13 2015
New Revision: 1667477
URL: http://svn.apache.org/r1667477
Log:
Never use atoi() for converting rev nums; use SVN_STR_TO_REV() instead,
which is a wrapper around atol().
* subversion/svnrdump/load_editor.c
(new_revision_record,
new_node_record): s/atoi/SVN_STR_TO_REV/
* tools/dev/fsfs-access-map.c
(open_file): s/atoi/SVN_STR_TO_REV/
Modified:
subversion/trunk/subversion/svnrdump/load_editor.c
subversion/trunk/tools/dev/fsfs-access-map.c
Modified: subversion/trunk/subversion/svnrdump/load_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/load_editor.c?rev=1667477&r1=1667476&r2=1667477&view=diff
==============================================================================
--- subversion/trunk/subversion/svnrdump/load_editor.c (original)
+++ subversion/trunk/subversion/svnrdump/load_editor.c Wed Mar 18 10:13:13 2015
@@ -407,7 +407,7 @@ new_revision_record(void **revision_bato
const char *hval = apr_hash_this_val(hi);
if (strcmp(hname, SVN_REPOS_DUMPFILE_REVISION_NUMBER) == 0)
- rb->rev = atoi(hval);
+ rb->rev = SVN_STR_TO_REV(hval);
}
SVN_ERR(svn_ra_get_latest_revnum(pb->session, &head_rev, pool));
@@ -570,7 +570,7 @@ new_node_record(void **node_baton,
if (strcmp(hname, SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_MD5) == 0)
nb->base_checksum = apr_pstrdup(rb->pool, hval);
if (strcmp(hname, SVN_REPOS_DUMPFILE_NODE_COPYFROM_REV) == 0)
- nb->copyfrom_rev = atoi(hval);
+ nb->copyfrom_rev = SVN_STR_TO_REV(hval);
if (strcmp(hname, SVN_REPOS_DUMPFILE_NODE_COPYFROM_PATH) == 0)
nb->copyfrom_path = apr_pstrdup(rb->pool, hval);
}
Modified: subversion/trunk/tools/dev/fsfs-access-map.c
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/dev/fsfs-access-map.c?rev=1667477&r1=1667476&r2=1667477&view=diff
==============================================================================
--- subversion/trunk/tools/dev/fsfs-access-map.c (original)
+++ subversion/trunk/tools/dev/fsfs-access-map.c Wed Mar 18 10:13:13 2015
@@ -198,9 +198,9 @@ open_file(const char *name, int handle)
/* determine first revision of rev / packed rev files */
if (strstr(name, "/db/revs/") != NULL && strstr(name, "manifest") == NULL)
if (strstr(name, ".pack/pack") != NULL)
- file->rev_num = atoi(strstr(name, "/db/revs/") + 9);
+ file->rev_num = SVN_STR_TO_REV(strstr(name, "/db/revs/") + 9);
else
- file->rev_num = atoi(strrchr(name, '/') + 1);
+ file->rev_num = SVN_STR_TO_REV(strrchr(name, '/') + 1);
else
file->rev_num = -1;