Remember to allocate extra byte for null terminator