summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmSystemTools.cxx9
-rw-r--r--Source/cmSystemTools.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index e2adabe..7230a64 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -2955,3 +2955,12 @@ bool cmSystemTools::StringToLong(const char* str, long* value)
*value = strtol(str, &endp, 10);
return (*endp == '\0') && (endp != str) && (errno == 0);
}
+
+//----------------------------------------------------------------------------
+bool cmSystemTools::StringToULong(const char* str, unsigned long* value)
+{
+ errno = 0;
+ char *endp;
+ *value = strtoul(str, &endp, 10);
+ return (*endp == '\0') && (endp != str) && (errno == 0);
+}
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index 6feb6c5..8ebb4e3 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -469,6 +469,7 @@ public:
/** Convert string to long. Expected that the whole string is an integer */
static bool StringToLong(const char* str, long* value);
+ static bool StringToULong(const char* str, unsigned long* value);
#ifdef _WIN32
struct WindowsFileRetry