improve portability - remove snprintf function