Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
da153b46
Commit
da153b46
authored
Jul 15, 2010
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
alloc: fix bug in tiny allocator
We can have a 0 byte in the *middle* of an encoding.
parent
bd294f1d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
ccan/alloc/tiny.c
ccan/alloc/tiny.c
+5
-5
No files found.
ccan/alloc/tiny.c
View file @
da153b46
...
...
@@ -152,13 +152,13 @@ static bool long_enough(unsigned long offset, unsigned long len,
static
unsigned
long
find_free_end
(
unsigned
char
*
arr
,
unsigned
long
arrsize
)
{
unsigned
long
end
;
long
i
;
for
(
end
=
0
;
end
<
arrsize
;
end
++
)
{
if
(
!
arr
[
end
])
break
;
for
(
i
=
arrsize
-
1
;
i
>=
0
;
i
--
)
{
if
(
arr
[
i
])
return
i
+
1
;
}
return
end
;
return
0
;
}
void
*
tiny_alloc_get
(
void
*
pool
,
unsigned
long
poolsize
,
...
...
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