summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-10-23 13:29:32 +0200
committerNoel Grandin <noel@peralex.com>2013-11-04 08:06:10 +0200
commit0e6a2601b39cbadaff7f7506ba9e804f108060db (patch)
treeffd6bb4970f689d20087b721eb8dfd4bc86cd53f /sal
parent457b349edbaf6d9dc747f3a631fee70e0c035bae (diff)
Convert code that calls OUString::getStr()[] to use the [] operator
This also means that this code now gets bounds checked in debug builds. Change-Id: Id777f85eaee6a737bbcb84625e6e110abe0e0f27
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/unx/uunxapi.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/sal/osl/unx/uunxapi.cxx b/sal/osl/unx/uunxapi.cxx
index d4116456b083..a9f3c5ff6d2a 100644
--- a/sal/osl/unx/uunxapi.cxx
+++ b/sal/osl/unx/uunxapi.cxx
@@ -128,9 +128,9 @@ int access_u(const rtl_uString* pustrPath, int mode)
{
rtl::OString fn = OUStringToOString(pustrPath);
#ifdef ANDROID
- if (strncmp(fn.getStr(), "/assets", sizeof("/assets")-1) == 0 &&
- (fn.getStr()[sizeof("/assets")-1] == '\0' ||
- fn.getStr()[sizeof("/assets")-1] == '/'))
+ if (fn.startsWith("/assets") &&
+ (fn[sizeof("/assets")-1] == '\0' ||
+ fn[sizeof("/assets")-1] == '/'))
{
struct stat stat;
if (lo_apk_lstat(fn.getStr(), &stat) == -1)
@@ -161,9 +161,9 @@ sal_Bool realpath_u(const rtl_uString* pustrFileName, rtl_uString** ppustrResolv
{
rtl::OString fn = OUStringToOString(pustrFileName);
#ifdef ANDROID
- if (strncmp(fn.getStr(), "/assets", sizeof("/assets")-1) == 0 &&
- (fn.getStr()[sizeof("/assets")-1] == '\0' ||
- fn.getStr()[sizeof("/assets")-1] == '/'))
+ if (fn.startsWith("/assets") &&
+ (fn[sizeof("/assets")-1] == '\0' ||
+ fn[sizeof("/assets")-1] == '/'))
{
if (access_u(pustrFileName, F_OK) == -1)
return sal_False;