mount_utils: convert to strnprintf()

parent 6137f654
...@@ -138,8 +138,8 @@ static int __fs_prepare(const char *fs_name, int fd_from) ...@@ -138,8 +138,8 @@ static int __fs_prepare(const char *fs_name, int fd_from)
* only use fds for mount. * only use fds for mount.
*/ */
if (fd_from >= 0) { if (fd_from >= 0) {
ret = snprintf(source, sizeof(source), "/proc/self/fd/%d", fd_from); ret = strnprintf(source, sizeof(source), "/proc/self/fd/%d", fd_from);
if (ret < 0 || ret >= sizeof(source)) if (ret < 0)
return log_error_errno(-EIO, EIO, "Failed to create /proc/self/fd/%d", fd_from); return log_error_errno(-EIO, EIO, "Failed to create /proc/self/fd/%d", fd_from);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment