summaryrefslogtreecommitdiffstats
path: root/sys-utils/zramctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys-utils/zramctl.c')
-rw-r--r--sys-utils/zramctl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys-utils/zramctl.c b/sys-utils/zramctl.c
index 4d900f119..642d88d41 100644
--- a/sys-utils/zramctl.c
+++ b/sys-utils/zramctl.c
@@ -215,9 +215,9 @@ static struct sysfs_cxt *zram_get_sysfs(struct zram *z)
return NULL;
if (*z->devname != '/') {
/* canonicalize the device name according to /sys */
- char name[PATH_MAX];
+ char name[sizeof(z->devname) - sizeof(_PATH_DEV)];
if (sysfs_get_devname(&z->sysfs, name, sizeof(name)))
- snprintf(z->devname, sizeof(z->devname), "/dev/%s", name);
+ snprintf(z->devname, sizeof(z->devname), _PATH_DEV "%s", name);
}
}