Yet another silly variant of sprintf

Used somewhere within libcurses, so provide an implementation.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>