break;
}
}
- strncpy(to, type, len);
- to[len-1] = '\0';
+ util_strlcpy(to, type, len);
}
/*
case 'd':
dev_specified = 1;
- strncpy(maj_min_dev, optarg, MAX_PATH_LEN);
- maj_min_dev[MAX_PATH_LEN-1] = '\0';
+ util_strlcpy(maj_min_dev, optarg, MAX_PATH_LEN);
break;
case 'e':
break;
case 'f':
- strncpy(config_file, optarg, MAX_PATH_LEN);
- config_file[MAX_PATH_LEN-1] = '\0';
+ util_strlcpy(config_file, optarg, MAX_PATH_LEN);
break;
case 'g':
}
if (optind < argc && !dev_specified) {
dev_specified = 1;
- strncpy(maj_min_dev, argv[optind], MAX_PATH_LEN);
- maj_min_dev[MAX_PATH_LEN-1] = '\0';
+ util_strlcpy(maj_min_dev, argv[optind], MAX_PATH_LEN);
}
return 0;
}
char name[UTIL_PATH_SIZE];
char *val;
- strncpy(name, property, sizeof(name));
+ util_strlcpy(name, property, sizeof(name));
val = strchr(name, '=');
if (val == NULL)
return NULL;