lxclock: convert to strnprintf()

parent 6ba3f517
......@@ -103,17 +103,17 @@ static char *lxclock_name(const char *p, const char *n)
if (!dest)
return NULL;
ret = snprintf(dest, len, "%s/lxc/lock/%s", rundir, p);
if (ret < 0 || (size_t)ret >= len)
return ret_set_errno(NULL, EIO);
ret = strnprintf(dest, len, "%s/lxc/lock/%s", rundir, p);
if (ret < 0)
return NULL;
ret = mkdir_p(dest, 0755);
if (ret < 0)
return NULL;
ret = snprintf(dest, len, "%s/lxc/lock/%s/.%s", rundir, p, n);
if (ret < 0 || (size_t)ret >= len)
return ret_set_errno(NULL, EIO);
ret = strnprintf(dest, len, "%s/lxc/lock/%s/.%s", rundir, p, n);
if (ret < 0)
return NULL;
return move_ptr(dest);
}
......
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