Helper method that savely handles the null termination of old C String data.
(String old)
| 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) { |
no outgoing calls
no test coverage detected