Skip to contentSkip to conversation

master - dmsetup: use dm_snprintf

PATCH Zdenek Kabelac 1 participant 1 message Mar 13, 2018

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=06c1f71897273558b5ffe607ceaee6d51576b861
Commit:        06c1f71897273558b5ffe607ceaee6d51576b861
Parent:        3f351466f7d2789b1f480cd0e370f978df8eb09b
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Mon Mar 12 11:57:31 2018 +0100
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Tue Mar 13 12:58:57 2018 +0100

dmsetup: use dm_snprintf

---
 tools/dmsetup.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
tools/dmsetup.c +1 -3
index 88fb044..c866cd6 100644
@@ -2297,7 +2297,6 @@ static int _mknodes(CMD_ARGS)
 
 static int _exec_command(const char *name)
 {
-	int n;
 	static char path[PATH_MAX];
 	static char *args[ARGS_MAX + 1];
 	static int argc = 0;
@@ -2310,8 +2309,7 @@ static int _exec_command(const char *name)
 	if (!dm_mknodes(name))
 		return_0;
 
-	n = snprintf(path, sizeof(path), "%s/%s", dm_dir(), name);
-	if (n < 0 || n > (int) sizeof(path) - 1)
+	if (dm_snprintf(path, sizeof(path), "%s/%s", dm_dir(), name) < 0)
 		return_0;
 
 	if (!argc) {