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
dfe59969
Commit
dfe59969
authored
Nov 19, 2012
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tal: tal_parent(NULL) should be NULL.
Signed-off-by:
Rusty Russell
<
rusty@rustcorp.com.au
>
parent
6c2ae376
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
3 deletions
+10
-3
ccan/tal/tal.c
ccan/tal/tal.c
+6
-1
ccan/tal/tal.h
ccan/tal/tal.h
+1
-1
ccan/tal/test/run.c
ccan/tal/test/run.c
+3
-1
No files found.
ccan/tal/tal.c
View file @
dfe59969
...
...
@@ -638,7 +638,12 @@ tal_t *tal_next(const tal_t *root, const tal_t *prev)
tal_t
*
tal_parent
(
const
tal_t
*
ctx
)
{
struct
group
*
group
;
struct
tal_hdr
*
t
=
debug_tal
(
to_tal_hdr
(
ctx
));
struct
tal_hdr
*
t
;
if
(
!
ctx
)
return
NULL
;
t
=
debug_tal
(
to_tal_hdr
(
ctx
));
while
(
!
(
group
=
find_property
(
t
,
GROUP
)))
t
=
t
->
next
;
...
...
ccan/tal/tal.h
View file @
dfe59969
...
...
@@ -159,7 +159,7 @@ tal_t *tal_next(const tal_t *root, const tal_t *prev);
* tal_parent - get the parent of a tal object.
* @ctx: The tal allocated object.
*
* Returns the parent, which may be NULL.
* Returns the parent, which may be NULL.
Returns NULL if @ctx is NULL.
*/
tal_t
*
tal_parent
(
const
tal_t
*
ctx
);
...
...
ccan/tal/test/run.c
View file @
dfe59969
...
...
@@ -7,10 +7,12 @@ int main(void)
char
*
parent
,
*
c
[
4
],
*
p
;
int
i
,
j
;
plan_tests
(
1
0
);
plan_tests
(
1
2
);
parent
=
tal
(
NULL
,
char
);
ok1
(
parent
);
ok1
(
tal_parent
(
parent
)
==
NULL
);
ok1
(
tal_parent
(
NULL
)
==
NULL
);
for
(
i
=
0
;
i
<
4
;
i
++
)
c
[
i
]
=
tal
(
parent
,
char
);
...
...
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