diff --git a/windows-jni-utils/src/main/java/coursier/jniutils/CString.java b/windows-jni-utils/src/main/java/coursier/jniutils/CString.java index 84ff7e5..9a93fe9 100644 --- a/windows-jni-utils/src/main/java/coursier/jniutils/CString.java +++ b/windows-jni-utils/src/main/java/coursier/jniutils/CString.java @@ -14,7 +14,7 @@ public static String fromC(byte[] data) { } byte[] data0 = data; if (remove > 0) - data0 = Arrays.copyOf(data, data.length - 1); + data0 = Arrays.copyOf(data, data.length - remove); return new String(data0, Charset.defaultCharset()); }