fix write beyond array bound
There was no space allocated for the terminating '\0' character... (cherry picked from commit b6c22a78)
Edited by Marco Cattaneo
There was no space allocated for the terminating '\0' character... (cherry picked from commit b6c22a78)