take into account count of chars already written when building stack string.