option = find_option(optname, OT_STR);
if (option == NULL)
- fatal("rc_conf_str: unkown config option requested: %s", optname);
+ fatal("rc_conf_str: unknown config option requested: %s", optname);
return (char *)option->val;
}
option = find_option(optname, OT_INT|OT_AUO);
if (option == NULL)
- fatal("rc_conf_int: unkown config option requested: %s", optname);
+ fatal("rc_conf_int: unknown config option requested: %s", optname);
return *((int *)option->val);
}
option = find_option(optname, OT_SRV);
if (option == NULL)
- fatal("rc_conf_srv: unkown config option requested: %s", optname);
+ fatal("rc_conf_srv: unknown config option requested: %s", optname);
return (SERVER *)option->val;
}
if ((h = strtok (buffer, " \t\n")) == NULL) /* first hostname */
continue;
- memset (hostnm, '\0', AUTH_ID_LEN);
- len = strlen (h);
- if (len > AUTH_ID_LEN)
- {
- len = AUTH_ID_LEN;
- }
- strncpy (hostnm, h, (size_t) len);
- hostnm[AUTH_ID_LEN] = '\0';
+ memset (hostnm, '\0', AUTH_ID_LEN + 1);
+ strlcpy (hostnm, h, AUTH_ID_LEN + 1);
if ((s = strtok (NULL, " \t\n")) == NULL) /* and secret field */
continue;
- memset (secret, '\0', MAX_SECRET_LENGTH);
- len = strlen (s);
- if (len > MAX_SECRET_LENGTH)
- {
- len = MAX_SECRET_LENGTH;
- }
- strncpy (secret, s, (size_t) len);
- secret[MAX_SECRET_LENGTH] = '\0';
+ memset (secret, '\0', MAX_SECRET_LENGTH + 1);
+ strlcpy (secret, s, MAX_SECRET_LENGTH + 1);
if (!strchr (hostnm, '/')) /* If single name form */
{