fix swprintf handling of nul character in output