confile: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/

parent 660c9191
...@@ -3052,19 +3052,19 @@ static int get_config_idmaps(const char *key, char *retv, int inlen, ...@@ -3052,19 +3052,19 @@ static int get_config_idmaps(const char *key, char *retv, int inlen,
* + * +
* sizeof(" ") * sizeof(" ")
* + * +
* sizeof(uint64_t) * sizeof(uint32_t)
* + * +
* sizeof(" ") * sizeof(" ")
* + * +
* sizeof(uint64_t) * sizeof(uint32_t)
* + * +
* sizeof(" ") * sizeof(" ")
* + * +
* sizeof(uint64_t) * sizeof(uint32_t)
* + * +
* \0 * \0
*/ */
#define __LXC_IDMAP_STR_BUF (3 * LXC_NUMSTRLEN64 + 3 + 1 + 1) #define __LXC_IDMAP_STR_BUF (3 * INTTYPE_TO_STRLEN(uint32_t) + 3 + 1 + 1)
char buf[__LXC_IDMAP_STR_BUF]; char buf[__LXC_IDMAP_STR_BUF];
if (!retv) if (!retv)
...@@ -3073,8 +3073,7 @@ static int get_config_idmaps(const char *key, char *retv, int inlen, ...@@ -3073,8 +3073,7 @@ static int get_config_idmaps(const char *key, char *retv, int inlen,
memset(retv, 0, inlen); memset(retv, 0, inlen);
listlen = lxc_list_len(&c->id_map); listlen = lxc_list_len(&c->id_map);
lxc_list_for_each(it, &c->id_map) lxc_list_for_each(it, &c->id_map) {
{
struct id_map *map = it->elem; struct id_map *map = it->elem;
ret = snprintf(buf, __LXC_IDMAP_STR_BUF, "%c %lu %lu %lu", ret = snprintf(buf, __LXC_IDMAP_STR_BUF, "%c %lu %lu %lu",
(map->idtype == ID_TYPE_UID) ? 'u' : 'g', (map->idtype == ID_TYPE_UID) ? 'u' : 'g',
...@@ -3515,9 +3514,8 @@ static int get_config_prlimit(const char *key, char *retv, int inlen, ...@@ -3515,9 +3514,8 @@ static int get_config_prlimit(const char *key, char *retv, int inlen,
return -1; return -1;
lxc_list_for_each(it, &c->limits) { lxc_list_for_each(it, &c->limits) {
char buf[LXC_NUMSTRLEN64 * 2 + 2]; /* 2 colon separated 64 bit /* 2 colon separated 64 bit integers or the word 'unlimited' */
integers or the word char buf[INTTYPE_TO_STRLEN(uint64_t) * 2 + 2];
'unlimited' */
int partlen; int partlen;
struct lxc_limit *lim = it->elem; struct lxc_limit *lim = it->elem;
......
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