sprintf->snprintf, fix some too short buffers