From 386c7078db18e0a6c074c26e186844a48642bca6 Mon Sep 17 00:00:00 2001 From: Zazsona <40435178+Zazsona@users.noreply.github.com> Date: Sun, 12 Feb 2023 19:28:51 +0000 Subject: [PATCH] Update "SetStringKeepTerminatorStyle" to resolve "?" OT bug. (#3778) --- PKHeX.Core/PKM/Shared/GBPKML.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/PKHeX.Core/PKM/Shared/GBPKML.cs b/PKHeX.Core/PKM/Shared/GBPKML.cs index cddb55001..fae466ab9 100644 --- a/PKHeX.Core/PKM/Shared/GBPKML.cs +++ b/PKHeX.Core/PKM/Shared/GBPKML.cs @@ -107,10 +107,7 @@ public abstract class GBPKML : GBPKM { // Reset the destination buffer based on the termination style of the existing string. bool zeroed = exist.IndexOf((byte)0) != -1; - byte fill = zeroed ? (byte)0 : StringConverter12.G1TerminatorCode; - exist.Fill(fill); - - int finalLength = Math.Min(value.Length + 1, exist.Length); - SetString(value, exist, finalLength); + StringConverterOption converterOption = (zeroed) ? StringConverterOption.ClearZero : StringConverterOption.Clear50; + SetString(value, exist, value.Length, converterOption); } }