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
13723cb9
Unverified
Commit
13723cb9
authored
May 04, 2021
by
Christian Brauner
Committed by
GitHub
May 04, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3823 from evverx/gcc-11-workaround
string_utils: get around GCC-11 false positives
parents
3176d82e
6d345aa4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
string_utils.c
src/lxc/string_utils.c
+7
-3
No files found.
src/lxc/string_utils.c
View file @
13723cb9
...
...
@@ -877,14 +877,18 @@ int parse_byte_size_string(const char *s, long long int *converted)
char
*
end
;
char
dup
[
INTTYPE_TO_STRLEN
(
long
long
int
)]
=
{
0
};
char
suffix
[
3
]
=
{
0
};
size_t
len
;
if
(
is_empty_string
(
s
)
)
if
(
!
s
)
return
ret_errno
(
EINVAL
);
end
=
stpncpy
(
dup
,
s
,
sizeof
(
dup
)
-
1
);
if
(
*
end
!=
'\0'
)
len
=
strlen
(
s
);
if
(
len
==
0
||
len
>
sizeof
(
dup
)
-
1
)
return
ret_errno
(
EINVAL
);
memcpy
(
dup
,
s
,
len
);
end
=
dup
+
len
;
if
(
isdigit
(
*
(
end
-
1
)))
suffix_len
=
0
;
else
if
(
isalpha
(
*
(
end
-
1
)))
...
...
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