Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
djinni
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
djinni
Commits
d7877cac
Commit
d7877cac
authored
Jul 26, 2016
by
Andrew Twyman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove stray c_str() to fix handling of embedded nulls
parent
94b98033
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
4 deletions
+5
-4
support-lib/jni/Marshal.hpp
support-lib/jni/Marshal.hpp
+1
-1
test-suite/handwritten-src/cpp/test_helpers.cpp
test-suite/handwritten-src/cpp/test_helpers.cpp
+2
-1
test-suite/handwritten-src/java/com/dropbox/djinni/test/ClientInterfaceImpl.java
...src/java/com/dropbox/djinni/test/ClientInterfaceImpl.java
+1
-1
test-suite/handwritten-src/objc/impl/DBClientInterfaceImpl.mm
...-suite/handwritten-src/objc/impl/DBClientInterfaceImpl.mm
+1
-1
No files found.
support-lib/jni/Marshal.hpp
View file @
d7877cac
...
@@ -174,7 +174,7 @@ namespace djinni
...
@@ -174,7 +174,7 @@ namespace djinni
static
LocalRef
<
JniType
>
fromCpp
(
JNIEnv
*
jniEnv
,
const
CppType
&
c
)
static
LocalRef
<
JniType
>
fromCpp
(
JNIEnv
*
jniEnv
,
const
CppType
&
c
)
{
{
return
{
jniEnv
,
jniStringFromUTF8
(
jniEnv
,
c
.
c_str
()
)};
return
{
jniEnv
,
jniStringFromUTF8
(
jniEnv
,
c
)};
}
}
};
};
...
...
test-suite/handwritten-src/cpp/test_helpers.cpp
View file @
d7877cac
...
@@ -76,7 +76,8 @@ bool TestHelpers::check_map_list_record(const MapListRecord & rec) {
...
@@ -76,7 +76,8 @@ bool TestHelpers::check_map_list_record(const MapListRecord & rec) {
}
}
static
const
std
::
string
HELLO_WORLD
=
"Hello World!"
;
static
const
std
::
string
HELLO_WORLD
=
"Hello World!"
;
static
const
std
::
string
NON_ASCII
=
"Non-ASCII / 非 ASCII 字符"
;
static
const
std
::
string
NON_ASCII
(
"Non-ASCII /
\0
非 ASCII 字符"
,
sizeof
(
"Non-ASCII /
\0
非 ASCII 字符"
)
-
1
);
void
TestHelpers
::
check_client_interface_ascii
(
const
std
::
shared_ptr
<
ClientInterface
>
&
i
)
{
void
TestHelpers
::
check_client_interface_ascii
(
const
std
::
shared_ptr
<
ClientInterface
>
&
i
)
{
ClientReturnedRecord
cReturnedRecord
=
i
->
get_record
(
5
,
HELLO_WORLD
,
{});
ClientReturnedRecord
cReturnedRecord
=
i
->
get_record
(
5
,
HELLO_WORLD
,
{});
...
...
test-suite/handwritten-src/java/com/dropbox/djinni/test/ClientInterfaceImpl.java
View file @
d7877cac
...
@@ -5,7 +5,7 @@ import javax.annotation.CheckForNull;
...
@@ -5,7 +5,7 @@ import javax.annotation.CheckForNull;
public
class
ClientInterfaceImpl
extends
ClientInterface
{
public
class
ClientInterfaceImpl
extends
ClientInterface
{
@Override
@Override
public
ClientReturnedRecord
getRecord
(
long
id
,
String
utf8string
,
String
misc
)
{
public
ClientReturnedRecord
getRecord
(
long
id
,
String
utf8string
,
String
misc
)
{
if
(!
utf8string
.
equals
(
"Non-ASCII / 非 ASCII 字符"
)
&&
!
utf8string
.
equals
(
"Hello World!"
))
{
if
(!
utf8string
.
equals
(
"Non-ASCII /
\0
非 ASCII 字符"
)
&&
!
utf8string
.
equals
(
"Hello World!"
))
{
throw
new
RuntimeException
(
"Unexpected string. Check UTF-8?"
);
throw
new
RuntimeException
(
"Unexpected string. Check UTF-8?"
);
}
}
return
new
ClientReturnedRecord
(
id
,
utf8string
,
misc
);
return
new
ClientReturnedRecord
(
id
,
utf8string
,
misc
);
...
...
test-suite/handwritten-src/objc/impl/DBClientInterfaceImpl.mm
View file @
d7877cac
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
#import "DBClientReturnedRecord+Private.h"
#import "DBClientReturnedRecord+Private.h"
static
NSString
*
DBHelloWorld
=
@"Hello World!"
;
static
NSString
*
DBHelloWorld
=
@"Hello World!"
;
static
NSString
*
DBNonAscii
=
@"Non-ASCII / 非 ASCII 字符"
;
static
NSString
*
DBNonAscii
=
@"Non-ASCII /
\0
非 ASCII 字符"
;
@implementation
DBClientInterfaceImpl
@implementation
DBClientInterfaceImpl
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment