From f409673e433e37d51e2259585dd2a8f31cef8af4 Mon Sep 17 00:00:00 2001 From: LunaTheFoxgirl Date: Fri, 1 Jul 2022 11:03:29 +0200 Subject: [PATCH] strip out null terminator --- source/psd/parser.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/psd/parser.d b/source/psd/parser.d index e5cbc29..3aa5e63 100644 --- a/source/psd/parser.d +++ b/source/psd/parser.d @@ -734,7 +734,7 @@ LayerMaskSection* parseLayer(ref File file, ref PSD psd, ulong sectionOffset, ui // If there's a unicode name we may as well use that here. import std.utf : toUTF8; - layer.name = utf16Name.toUTF8; + layer.name = utf16Name.toUTF8[0..$-1]; // strip null character as well // skip possible padding bytes file.skip(length - 4u - characterCountWithoutNull * ushort.sizeof);