summaryrefslogtreecommitdiff
path: root/kerberosIV/krb/getrealm.c
diff options
context:
space:
mode:
Diffstat (limited to 'kerberosIV/krb/getrealm.c')
-rw-r--r--kerberosIV/krb/getrealm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kerberosIV/krb/getrealm.c b/kerberosIV/krb/getrealm.c
index 10a3b20610c..45ab920d575 100644
--- a/kerberosIV/krb/getrealm.c
+++ b/kerberosIV/krb/getrealm.c
@@ -83,9 +83,9 @@ krb_realmofhost(host)
if ((trans_file = fopen(KRB_RLM_TRANS, "r")) == (FILE *) 0) {
char tbuf[128];
char *tdir = (char *) getenv("KRBCONFDIR");
- strncpy(tbuf, tdir ? tdir : "/etc", sizeof(tbuf));
- strncat(tbuf, "/krb.realms", sizeof(tbuf));
- tbuf[sizeof(tbuf)-1] = 0;
+ strncpy(tbuf, tdir ? tdir : "/etc", sizeof(tbuf)-1);
+ tbuf[sizeof(tbuf)-1] = '\0';
+ strncat(tbuf, "/krb.realms", sizeof(tbuf) - strlen(tbuf));
if ((trans_file = fopen(tbuf,"r")) == NULL)
return(ret_realm[0] ? ret_realm : NULL); /* krb_errno = KRB_NO_TRANS */
}