Fixed string reading issue

"msg" can contain a string up to 255 chars and stops reading once a
newline character is reached