Use correct buffer size for snprintf

Instead of using the size of the buffer to size of a pointer was used.
This leaded to a string truncation for unknown state.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>