[Cmake-commits] CMake branch, next, updated. v3.1.0-rc2-972-g1b1987b

Rolf Eike Beer eike at sf-mail.de
Mon Dec 1 11:19:54 EST 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  1b1987b8d8d572da275cd0d028bfd19e66a7a6f7 (commit)
       via  0f1aa6e639751f787096e66ea266958ca57a864f (commit)
      from  7bf67118463e1111560f0c8a62d5064455819365 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1b1987b8d8d572da275cd0d028bfd19e66a7a6f7
commit 1b1987b8d8d572da275cd0d028bfd19e66a7a6f7
Merge: 7bf6711 0f1aa6e
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Mon Dec 1 11:19:54 2014 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Dec 1 11:19:54 2014 -0500

    Merge topic 'file-LOCK-command' into next
    
    0f1aa6e6 cmSystemTools::StringToInt(): reimplement without sscanf()


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0f1aa6e639751f787096e66ea266958ca57a864f
commit 0f1aa6e639751f787096e66ea266958ca57a864f
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Mon Dec 1 17:18:59 2014 +0100
Commit:     Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Mon Dec 1 17:18:59 2014 +0100

    cmSystemTools::StringToInt(): reimplement without sscanf()

diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 4c08e07..9852dd6 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -2927,7 +2927,7 @@ std::vector<std::string> cmSystemTools::tokenize(const std::string& str,
 //----------------------------------------------------------------------------
 bool cmSystemTools::StringToInt(const char* str, int* value)
 {
-  char unused;
-  const int result = sscanf(str, "%d%c", value, &unused);
-  return (result == 1);
+  char *endp;
+  *value = static_cast<int>(strtol(str, &endp, 10));
+  return (*endp == '\0') && (endp != str);
 }

-----------------------------------------------------------------------

Summary of changes:
 Source/cmSystemTools.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list