Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libloc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
libloc
Commits
7db88f1b
Commit
7db88f1b
authored
Mar 09, 2022
by
Michael Tremer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
country-list: Grow like AS list
Signed-off-by:
Michael Tremer
<
michael.tremer@ipfire.org
>
parent
635c344a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
src/country-list.c
src/country-list.c
+6
-2
No files found.
src/country-list.c
View file @
7db88f1b
...
...
@@ -31,7 +31,11 @@ struct loc_country_list {
size_t
size
;
};
static
int
loc_country_list_grow
(
struct
loc_country_list
*
list
,
size_t
size
)
{
static
int
loc_country_list_grow
(
struct
loc_country_list
*
list
)
{
size_t
size
=
list
->
elements_size
*
2
;
if
(
size
<
1024
)
size
=
1024
;
DEBUG
(
list
->
ctx
,
"Growing country list %p by %zu to %zu
\n
"
,
list
,
size
,
list
->
elements_size
+
size
);
...
...
@@ -124,7 +128,7 @@ LOC_EXPORT int loc_country_list_append(
// Check if we have space left
if
(
list
->
size
>=
list
->
elements_size
)
{
int
r
=
loc_country_list_grow
(
list
,
64
);
int
r
=
loc_country_list_grow
(
list
);
if
(
r
)
return
r
;
}
...
...
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