fixed writeln()

small fix but incredibly useful for debugging 
That is as broken as the previous implementation as there no guarantee that this is 0 terminated. I'm not sure it is worth investing time into this.