Skip to content

Commit

Permalink
Fix line ending
Browse files Browse the repository at this point in the history
Rename method reference
  • Loading branch information
purejava committed Nov 3, 2022
1 parent 13c188d commit 8170a2f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/org/purejava/windows/MemoryAllocator.java
Expand Up @@ -8,7 +8,8 @@ public static MemorySegment ALLOCATE_FOR(String str) {
return RuntimeHelper.CONSTANT_ALLOCATOR.allocateUtf8String(str);
}

public static MemorySegment ALLOCATE_FOR_WCHAR_T(String str) {
public static MemorySegment ALLOCATE_WCHAR_T_FOR(String str) {
str += "\0"; // The \0 character marks the end of the string stored in a char array
return RuntimeHelper.CONSTANT_ALLOCATOR.allocateArray(ValueLayout.JAVA_CHAR, str.toCharArray());
}
}

0 comments on commit 8170a2f

Please sign in to comment.