summaryrefslogtreecommitdiff
path: root/jvmfwk
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-03-22 21:40:55 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-03-22 21:40:55 +0100
commit25ecb6f627852bc23ec8395ef24d8e90467d5758 (patch)
tree8a1a06bae21f8cd28e2276dee2baa61f756340c4 /jvmfwk
parent73a644f438ffe436776bad708231a7dd73dd49e0 (diff)
Use rtl::isAscii* instead of ctype.h is* (and fix passing plain char)
Change-Id: I18f9a2ad4506edc76b74dde229f2fd296bffed88
Diffstat (limited to 'jvmfwk')
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
index b4ad7019d449..290faed43ab6 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
@@ -23,6 +23,7 @@
#include "osl/thread.h"
#include "osl/process.h"
#include "osl/security.hxx"
+#include <rtl/character.hxx>
#include <string.h>
#include <ctype.h>
#include "diagnostics.h"
@@ -77,7 +78,7 @@ bool SunVersion::init(const char *szVersion)
//char must me a number 0 - 999 and no leading
while (true)
{
- if (pCur < pEnd && isdigit(*pCur))
+ if (pCur < pEnd && rtl::isAsciiDigit(static_cast<unsigned char>(*pCur)))
{
if (pCur < pEnd)
pCur ++;
@@ -94,7 +95,8 @@ bool SunVersion::init(const char *szVersion)
(nPart < 2 && *pCur == '.') )
&& (
//prevent 1.4.0. 1.4.0-
- pCur + 1 != pEnd || isdigit(*(pCur))) )
+ pCur + 1 != pEnd
+ || rtl::isAsciiDigit(static_cast<unsigned char>(*pCur))) )
{
int len = pCur - pLast;
if (len >= 127)
@@ -113,7 +115,9 @@ bool SunVersion::init(const char *szVersion)
//check next character
if (! ( (pCur < pEnd)
- && ( (nPart < 3) && isdigit(*pCur))))
+ && ( (nPart < 3)
+ && rtl::isAsciiDigit(
+ static_cast<unsigned char>(*pCur)))))
return false;
}
else
@@ -133,7 +137,7 @@ bool SunVersion::init(const char *szVersion)
{
if (pCur <= pEnd)
{
- if ( ! isdigit(*pCur))
+ if ( ! rtl::isAsciiDigit(static_cast<unsigned char>(*pCur)))
{
//1.8.0_102-, 1.8.0_01a,
size_t len = pCur - pLast;
@@ -184,7 +188,8 @@ bool SunVersion::init(const char *szVersion)
if (m_preRelease == Rel_FreeBSD)
{
pCur++; //eliminate 'p'
- if (pCur < pEnd && isdigit(*pCur))
+ if (pCur < pEnd
+ && rtl::isAsciiDigit(static_cast<unsigned char>(*pCur)))
pCur ++;
int len = pCur - pLast -1; //eliminate 'p'
if (len >= 127)