There is already a snprintf.c in src/util. Comments there indicate that some vendors' versions are broken.