tmpstr;
tmpstr = strtok(NULL, ",")) {
/* copy option to temp buffer */
- xstrlcpy(oneopt, tmpstr, 80);
+ xstrlcpy(oneopt, tmpstr, sizeof(oneopt));
/* if option has a value such as rsize=1024, chop the value part */
if ((eq = haseq(oneopt)))
*eq = '\0';
* error code 0 at the end. If they all fail then return
* the last error code.
*/
- xstrlcpy(fs_name, mf->mf_info, MAXPATHLEN);
+ xstrlcpy(fs_name, mf->mf_info, sizeof(fs_name));
if ((rfs_dir = strchr(fs_name, ':')) == (char *) NULL) {
plog(XLOG_FATAL, "amfs_host_mount: mf_info has no colon");
error = EINVAL;
void
am_set_hostname(char *hn)
{
- xstrlcpy(am_hostname, hn, MAXHOSTNAMELEN);
+ xstrlcpy(am_hostname, hn, sizeof(am_hostname));
}
switch (last_count) {
case 0: /* never printed at all */
last_count = 1;
- if (strlcpy(last_msg, msg, 1024) >= 1024) /* don't use xstrlcpy here (recursive!) */
+ if (strlcpy(last_msg, msg, sizeof(last_msg)) >= sizeof(last_msg)) /* don't use xstrlcpy here (recursive!) */
fprintf(stderr, "real_plog: string \"%s\" truncated to \"%s\"\n", last_msg, msg);
last_lvl = lvl;
show_time_host_and_name(lvl); /* mimic syslog header */
last_count++;
} else { /* last msg printed once, new one differs */
/* last_count remains at 1 */
- if (strlcpy(last_msg, msg, 1024) >= 1024) /* don't use xstrlcpy here (recursive!) */
+ if (strlcpy(last_msg, msg, sizeof(last_msg)) >= sizeof(last_msg)) /* don't use xstrlcpy here (recursive!) */
fprintf(stderr, "real_plog: string \"%s\" truncated to \"%s\"\n", last_msg, msg);
last_lvl = lvl;
show_time_host_and_name(lvl); /* mimic syslog header */