From 76766aef149ac5b9562ab9bcca33830f80beab9d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Fri, 16 Feb 2018 15:32:26 +0100 Subject: [PATCH] mount: rename tmp variables in the mount_add_list() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Both of them are used once only so there is no real need for the tmp(2) variables. We can just name them nicer to make code easier to read. Signed-off-by: Rafał Miłecki --- mount.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mount.c b/mount.c index bf5fbfd..f2c15a0 100644 --- a/mount.c +++ b/mount.c @@ -152,7 +152,7 @@ static void mount_add_list(char *name, char *dev, char *serial, char *vendor, char *model, char *rev, int ignore, char *size, char *sector_size, int fs) { struct mount *mount; - char tmp[64], tmp2[64]; + char dev_path[64], dev_link[64]; mount = malloc(sizeof(struct mount)); INIT_LIST_HEAD(&mount->list); @@ -172,9 +172,9 @@ static void mount_add_list(char *name, char *dev, char *serial, mount->status = STATUS_IGNORE; } else { log_printf("new mount : %s -> %s (%s)\n", name, dev, fs_names[mount->fs]); - snprintf(tmp, 64, "%s%s", uci_path, name); - snprintf(tmp2, 64, "/tmp/run/mountd/%s", dev); - symlink(tmp2, tmp); + snprintf(dev_link, sizeof(dev_link), "%s%s", uci_path, name); + snprintf(dev_path, sizeof(dev_path), "%s%s", "/tmp/run/mountd/", dev); + symlink(dev_path, dev_link); if (!mount_new("/tmp/run/mountd/", dev)) system_printf("ACTION=add DEVICE=%s NAME=%s /sbin/hotplug-call mount", dev, name); } -- 2.25.1