Skip to content

Commit 25f0474

Browse files
committed
Another try.
1 parent 24d4edd commit 25f0474

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Hexa.NET.ImGui.Widgets/Dialogs/FileUtilities.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -580,11 +580,11 @@ private static void FileStat(StdWString str, out Stat stat)
580580
byte* pStr0;
581581
if (strSize0 >= Utils.MaxStackallocSize)
582582
{
583-
pStr0 = Utils.Alloc<byte>(strSize0);
583+
pStr0 = Utils.Alloc<byte>(strSize0 + 1);
584584
}
585585
else
586586
{
587-
byte* pStrStack0 = stackalloc byte[strSize0];
587+
byte* pStrStack0 = stackalloc byte[strSize0 + 1];
588588
pStr0 = pStrStack0;
589589
}
590590
Encoding.UTF8.GetBytes(str.Data, str.Size, pStr0, strSize0);
@@ -872,11 +872,11 @@ private static void OSXFileStat(StdWString str, out OSXStat stat)
872872
byte* pStr0;
873873
if (strSize0 >= Utils.MaxStackallocSize)
874874
{
875-
pStr0 = Utils.Alloc<byte>(strSize0);
875+
pStr0 = Utils.Alloc<byte>(strSize0 + 1);
876876
}
877877
else
878878
{
879-
byte* pStrStack0 = stackalloc byte[strSize0];
879+
byte* pStrStack0 = stackalloc byte[strSize0 + 1];
880880
pStr0 = pStrStack0;
881881
}
882882
Encoding.UTF8.GetBytes(str.Data, str.Size, pStr0, strSize0);

0 commit comments

Comments
 (0)