Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix native conversion for empty CFStringRef. #1275

Merged
merged 1 commit into from
Nov 26, 2020
Merged

Fix native conversion for empty CFStringRef. #1275

merged 1 commit into from
Nov 26, 2020

Conversation

dyorgio
Copy link
Contributor

@dyorgio dyorgio commented Nov 24, 2020

If you try to convert a CFStringRef with empty string (char[0]) an Exception is throws in com.sun.jna.Memory(long) constructor:
java.lang.IllegalArgumentException: Allocation size must be greater than zero

Issue: #1274

Copy link
Contributor

@dbwiddis dbwiddis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for the fix and the updated test case. One typo in the changelog, and can you squash the commits please?

CHANGES.md Outdated Show resolved Hide resolved
@dbwiddis dbwiddis linked an issue Nov 24, 2020 that may be closed by this pull request
@dbwiddis
Copy link
Contributor

Looks great to me. I'll merge after CI tests pass.

@dyorgio
Copy link
Contributor Author

dyorgio commented Nov 25, 2020

Tks @dbwiddis , looking forward to contribute with some macOs binds when I consider it more stable.

If you try to convert a CFStringRef with empty string (char[0]) an Exception is throws in con.sun.jna.Memory(long) constructor:
java.lang.IllegalArgumentException: Allocation size must be greater than zero
@dbwiddis dbwiddis merged commit 3241510 into java-native-access:master Nov 26, 2020
tresf pushed a commit to tresf/jna that referenced this pull request Dec 1, 2020
If you try to convert a CFStringRef with empty string (char[0]) an Exception is throws in con.sun.jna.Memory(long) constructor:
java.lang.IllegalArgumentException: Allocation size must be greater than zero
dbwiddis pushed a commit to dbwiddis/jna that referenced this pull request Jan 29, 2021
If you try to convert a CFStringRef with empty string (char[0]) an Exception is throws in con.sun.jna.Memory(long) constructor:
java.lang.IllegalArgumentException: Allocation size must be greater than zero
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Empty CFStringRefthrows Exception if stringValue is called (macOS)
3 participants