On Monday, 13 December 2021 at 20:58:42 UTC, forkit wrote: > immutable(char)[] replaceChar(char* str, ulong len, char ch1, > char ch2) > //snip > return to!(immutable(char)[])(str); > } You're calling a `to` on a char pointer, which, ostensibly, would look for null terminator. Which there may not be any if you do a .dup.