MCPcopy Create free account
hub / github.com/demoth/jake2 / CtoJava

Method CtoJava

qcommon/src/main/java/jake2/qcommon/util/Lib.java:327–331  ·  view source on GitHub ↗

Helper method that savely handles the null termination of old C String data.

(String old)

Source from the content-addressed store, hash-verified

325
326 /** Helper method that savely handles the null termination of old C String data. */
327 public static String CtoJava(String old) {
328 int index = old.indexOf('\0');
329 if (index == 0) return "";
330 return (index > 0) ? old.substring(0, index) : old;
331 }
332
333 /** Helper method that savely handles the null termination of old C String data. */
334 public static String CtoJava(byte[] old) {

Callers 2

RequestNextDownloadMethod · 0.95
freadStringMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected