Reduce stack usage, 32 bytes are enough here, no need to take 8k in the stack. (19 would be enough, but be safe...) Use the size of the buffer as opposed to MAX_STRING_LEN. Followup to r1491221+r1491479: change consistently the same code used in another place in the same file.