*
* Copyright (C) 2004 Jana Saout <jana@saout.de>
* Copyright (C) 2004-2007 Clemens Fruhwirth <clemens@endorphin.org>
- * Copyright (C) 2009-2020 Red Hat, Inc. All rights reserved.
- * Copyright (C) 2009-2020 Milan Broz
+ * Copyright (C) 2009-2021 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2009-2021 Milan Broz
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
if (dm_is_dm_kernel_name(devname))
return NULL;
- snprintf(part_path, sizeof(part_path), "/dev/%s", devname);
+ if (snprintf(part_path, sizeof(part_path), "/dev/%s", devname) < 0)
+ return NULL;
+
return strdup(part_path);
}