From a99a30d720881ccff44d2bfb72f351182b099d76 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Fri, 25 Sep 2009 19:06:05 +0000 Subject: [PATCH] missing dm_snprintf --- libdm/libdm-common.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c index c985ad785..175d8d1d9 100644 --- a/libdm/libdm-common.c +++ b/libdm/libdm-common.c @@ -261,7 +261,11 @@ int dm_task_set_name(struct dm_task *dmt, const char *name) * under /dev/mapper, use that name directly. Otherwise call * _find_dm_name_of_device() to scan _dm_dir for a match. */ - snprintf(path, sizeof(path), "%s/%s", _dm_dir, pos + 1); + if (dm_snprintf(path, sizeof(path), "%s/%s", _dm_dir, + pos + 1) == -1) { + log_error("Couldn't create path for %s", pos + 1); + return 0; + } if (!stat(path, &st2) && (st1.st_rdev == st2.st_rdev)) name = pos + 1; -- 2.43.5