krb5_princ_set_realm_length (context, princ, value)
(princ)->realm.length = (value)
krb5_princ_set_realm_length