From: Alasdair Kergon Date: Fri, 25 Sep 2009 19:06:05 +0000 (+0000) Subject: missing dm_snprintf X-Git-Tag: old-v2_02_53~1 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=a99a30d720881ccff44d2bfb72f351182b099d76;p=lvm2.git missing dm_snprintf --- 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;