diff options
Diffstat (limited to 'crypto/heimdal/lib/krb5/keytab_keyfile.c')
-rw-r--r-- | crypto/heimdal/lib/krb5/keytab_keyfile.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/crypto/heimdal/lib/krb5/keytab_keyfile.c b/crypto/heimdal/lib/krb5/keytab_keyfile.c index e4c4eb603ce5..7bfc59c31096 100644 --- a/crypto/heimdal/lib/krb5/keytab_keyfile.c +++ b/crypto/heimdal/lib/krb5/keytab_keyfile.c @@ -33,7 +33,7 @@ #include "krb5_locl.h" -RCSID("$Id: keytab_keyfile.c,v 1.14 2002/09/09 14:22:26 nectar Exp $"); +RCSID("$Id: keytab_keyfile.c,v 1.14.2.1 2002/10/21 16:07:26 joda Exp $"); /* afs keyfile operations --------------------------------------- */ @@ -82,8 +82,7 @@ get_cell_and_realm (krb5_context context, krb5_set_error_string (context, "no cell in %s", AFS_SERVERTHISCELL); return EINVAL; } - if (buf[strlen(buf) - 1] == '\n') - buf[strlen(buf) - 1] = '\0'; + buf[strcspn(buf, "\n")] = '\0'; fclose(f); d->cell = strdup (buf); @@ -100,8 +99,7 @@ get_cell_and_realm (krb5_context context, AFS_SERVERMAGICKRBCONF); return EINVAL; } - if (buf[strlen(buf)-1] == '\n') - buf[strlen(buf)-1] = '\0'; + buf[strcspn(buf, "\n")] = '\0'; fclose(f); } /* uppercase */ |