Skip to content

Commit

Permalink
Fix type declaration for value returned by GetByteArrayElements.
Browse files Browse the repository at this point in the history
It returns a poineter to a jbyte, but it was incorrectly declared as a
pointer to a const jbyte.

The warning here is now resolved.

Related to #41.
  • Loading branch information
aclemons committed Dec 12, 2024
1 parent ee73b60 commit 99fe57e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/native/org_gnu_readline_Readline.c
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ char* fromjstring(JNIEnv *const env, jstring value) {
return NULL;
}

const jbyte* bytes = (*env)->GetByteArrayElements(env, jstringJBytes, NULL);
jbyte *const bytes = (*env)->GetByteArrayElements(env, jstringJBytes, NULL);

if (2*length > bufLength) {
if (allocBuffer(2*length)) {
Expand Down

0 comments on commit 99fe57e

Please sign in to comment.