If you used xcalloc(), you'd have all fields initially NULL/0-filled, so would only need to set the fields that actually have non-zero values.