diff --git a/Misc/Util.cs b/Misc/Util.cs index 93e10d05c..c305a3d15 100644 --- a/Misc/Util.cs +++ b/Misc/Util.cs @@ -177,8 +177,7 @@ internal static string CleanFileName(string fileName) } internal static string TrimFromZero(string input) { - int index = input.IndexOf('\0'); - return index < 0 ? input : input.Substring(0, index); + return input.TrimEnd('\0'); } internal static string[] getStringList(string f, string l) {