only: EPIC: Improve toolset for default tune canned tune generation #4871
This commit is contained in:
parent
4096a61a7e
commit
7ddc622d35
|
@ -2,6 +2,7 @@ package com.opensr5.ini.field;
|
||||||
|
|
||||||
import com.opensr5.ConfigurationImage;
|
import com.opensr5.ConfigurationImage;
|
||||||
import com.rusefi.tune.xml.Constant;
|
import com.rusefi.tune.xml.Constant;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
|
||||||
|
@ -22,6 +23,19 @@ public class StringIniField extends IniField {
|
||||||
public String getValue(ConfigurationImage image) {
|
public String getValue(ConfigurationImage image) {
|
||||||
String value = new String(image.getContent(), getOffset(), size);
|
String value = new String(image.getContent(), getOffset(), size);
|
||||||
value = value.trim();
|
value = value.trim();
|
||||||
|
value = trimAtZeroSymbol(value);
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private static String trimAtZeroSymbol(String value) {
|
||||||
|
for (int i = 0; i < value.length(); i++) {
|
||||||
|
// C/C++ zero string is terminated but java XML looks for all 'size' of symbols, let's convert
|
||||||
|
if (value.charAt(i) == 0) {
|
||||||
|
value = value.substring(0, i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue