Skip to content

Commit 8170a2f

Browse files
committed
Fix line ending
Rename method reference
1 parent 13c188d commit 8170a2f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/main/java/org/purejava/windows/MemoryAllocator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ public static MemorySegment ALLOCATE_FOR(String str) {
88
return RuntimeHelper.CONSTANT_ALLOCATOR.allocateUtf8String(str);
99
}
1010

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

0 commit comments

Comments
 (0)