mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-15 01:54:18 +00:00
confile_utils: apply strprint()
Signed-off-by: Donghwa Jeong <dh48.jeong@samsung.com>
This commit is contained in:
parent
7af82fa828
commit
1396b61091
@ -635,32 +635,47 @@ int lxc_get_conf_str(char *retv, int inlen, const char *value)
|
||||
|
||||
int lxc_get_conf_int(struct lxc_conf *c, char *retv, int inlen, int v)
|
||||
{
|
||||
int len;
|
||||
int fulllen = 0;
|
||||
|
||||
if (!retv)
|
||||
inlen = 0;
|
||||
else
|
||||
memset(retv, 0, inlen);
|
||||
|
||||
return snprintf(retv, inlen, "%d", v);
|
||||
strprint(retv, inlen, "%d", v);
|
||||
|
||||
return fulllen;
|
||||
}
|
||||
|
||||
int lxc_get_conf_size_t(struct lxc_conf *c, char *retv, int inlen, size_t v)
|
||||
{
|
||||
int len;
|
||||
int fulllen = 0;
|
||||
|
||||
if (!retv)
|
||||
inlen = 0;
|
||||
else
|
||||
memset(retv, 0, inlen);
|
||||
|
||||
return snprintf(retv, inlen, "%zu", v);
|
||||
strprint(retv, inlen, "%zu", v);
|
||||
|
||||
return fulllen;
|
||||
}
|
||||
|
||||
int lxc_get_conf_uint64(struct lxc_conf *c, char *retv, int inlen, uint64_t v)
|
||||
{
|
||||
int len;
|
||||
int fulllen = 0;
|
||||
|
||||
if (!retv)
|
||||
inlen = 0;
|
||||
else
|
||||
memset(retv, 0, inlen);
|
||||
|
||||
return snprintf(retv, inlen, "%"PRIu64, v);
|
||||
strprint(retv, inlen, "%"PRIu64, v);
|
||||
|
||||
return fulllen;
|
||||
}
|
||||
|
||||
bool parse_limit_value(const char **value, rlim_t *res)
|
||||
|
Loading…
Reference in New Issue
Block a user