Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
bf5174e0
Commit
bf5174e0
authored
Nov 15, 2016
by
Christian Brauner
Committed by
Stéphane Graber
Nov 17, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgroups: use %zu format specifier to print size_t
Signed-off-by:
Christian Brauner
<
christian.brauner@canonical.com
>
parent
8da006e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
cgfsng.c
src/lxc/cgroups/cgfsng.c
+6
-5
No files found.
src/lxc/cgroups/cgfsng.c
View file @
bf5174e0
...
@@ -358,20 +358,21 @@ static uint32_t *lxc_cpumask(char *buf, size_t nbits)
...
@@ -358,20 +358,21 @@ static uint32_t *lxc_cpumask(char *buf, size_t nbits)
}
}
/* The largest integer that can fit into long int is 2^64. This is a
/* The largest integer that can fit into long int is 2^64. This is a
* 20-digit number. */
* 20-digit number.
#define LEN 21
*/
#define __IN_TO_STR_LEN 21
/* Turn cpumask into simple, comma-separated cpulist. */
/* Turn cpumask into simple, comma-separated cpulist. */
static
char
*
lxc_cpumask_to_cpulist
(
uint32_t
*
bitarr
,
size_t
nbits
)
static
char
*
lxc_cpumask_to_cpulist
(
uint32_t
*
bitarr
,
size_t
nbits
)
{
{
size_t
i
;
size_t
i
;
int
ret
;
int
ret
;
char
numstr
[
LEN
]
=
{
0
};
char
numstr
[
__IN_TO_STR_
LEN
]
=
{
0
};
char
**
cpulist
=
NULL
;
char
**
cpulist
=
NULL
;
for
(
i
=
0
;
i
<=
nbits
;
i
++
)
{
for
(
i
=
0
;
i
<=
nbits
;
i
++
)
{
if
(
is_set
(
i
,
bitarr
))
{
if
(
is_set
(
i
,
bitarr
))
{
ret
=
snprintf
(
numstr
,
LEN
,
"%l
u"
,
i
);
ret
=
snprintf
(
numstr
,
__IN_TO_STR_LEN
,
"%z
u"
,
i
);
if
(
ret
<
0
||
(
size_t
)
ret
>=
LEN
)
{
if
(
ret
<
0
||
(
size_t
)
ret
>=
__IN_TO_STR_
LEN
)
{
lxc_free_array
((
void
**
)
cpulist
,
free
);
lxc_free_array
((
void
**
)
cpulist
,
free
);
return
NULL
;
return
NULL
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment