We currently only have snprintf replacement for C99.

Unfortunately we can't yet use C99 for sprintf(), fprintf(). But we
*can* for snprintf() (and Log() which calls snprintf).

Also removed an unnecessary cast.
Fixed stuff according to code review.