aboutsummaryrefslogtreecommitdiffstats
path: root/kerberos.c
diff options
context:
space:
mode:
Diffstat (limited to 'kerberos.c')
-rw-r--r--kerberos.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/kerberos.c b/kerberos.c
index 141c9e3a..6c8b5a0a 100644
--- a/kerberos.c
+++ b/kerberos.c
@@ -93,16 +93,14 @@ int do_rfc1731(int sock, const char *command, const char *truename)
* 32-bit number in network byte order.
*/
- strncpy(srvinst, truename, (sizeof srvinst)-1);
- srvinst[(sizeof srvinst)-1] = '\0';
+ strlcpy(srvinst, truename, sizeof srvinst);
for (p = srvinst; *p; p++) {
if (isupper((unsigned char)*p)) {
*p = tolower((unsigned char)*p);
}
}
- strncpy(srvrealm, (char *)krb_realmofhost(srvinst), (sizeof srvrealm)-1);
- srvrealm[(sizeof srvrealm)-1] = '\0';
+ strlcpy(srvrealm, (char *)krb_realmofhost(srvinst), sizeof srvrealm);
if ((p = strchr(srvinst, '.')) != NULL) {
*p = '\0';
}