int sysfs_check_holders(char * check_devt, char * new_devt)
{
unsigned int major, new_minor, table_minor;
- char path[PATH_SIZE], check_dev[PATH_SIZE];
+ char path[PATH_MAX], check_dev[PATH_SIZE];
char * table_name;
DIR *dirfd;
struct dirent *holder;
condlog(3, "%s: checking holder", check_dev);
- snprintf(path, PATH_SIZE, "/sys/block/%s/holders", check_dev);
+ snprintf(path, sizeof(path), "/sys/block/%s/holders", check_dev);
dirfd = opendir(path);
if (dirfd == NULL) {
condlog(3, "%s: failed to open directory %s (%d)",
int systemd_service_enabled_in(const char *dev, const char *prefix)
{
- char path[PATH_SIZE], file[PATH_SIZE], service[PATH_SIZE];
+ char path[PATH_SIZE], file[PATH_MAX], service[PATH_SIZE];
DIR *dirfd;
struct dirent *d;
int found = 0;
p = d->d_name + strlen(d->d_name) - 6;
if (strcmp(p, ".wants"))
continue;
- snprintf(file, PATH_SIZE, "%s/%s/%s",
+ snprintf(file, sizeof(file), "%s/%s/%s",
path, d->d_name, service);
if (stat(file, &stbuf) == 0) {
condlog(3, "%s: found %s", dev, file);