Fixed Unicode bug in GetString

pull/60/head
David Hall 2019-03-25 17:40:06 -07:00
parent 178701d505
commit 3c40989527
1 changed files with 1 additions and 1 deletions

View File

@ -173,7 +173,7 @@ namespace Vanara.Extensions
}
else
{
for (var uptr = (ushort*)ptr; chkLen < allocatedBytes && *uptr != 0; chkLen += 2, uptr++)
for (var uptr = (ushort*)ptr; chkLen + 2 <= allocatedBytes && *uptr != 0; chkLen += 2, uptr++)
sb.Append((char)*uptr);
}
}