Hmm, isn't it allowed to pass NULL to the %s format specifier of printf/snprintf and friends? Or is it a GCC feature that it prints the string "(null)" then? That is perfectly "valgrind-clean".