Added another length check (weird snprintf implementes out there)