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
e16aa40b
Commit
e16aa40b
authored
Jul 31, 2019
by
Chirimen-Jako
Committed by
Rusty Russell
Aug 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Suppress false positive warning "-Wmaybe-uninitialized" with GCC -O3
parent
920ca95d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
ccan/tal/path/path.c
ccan/tal/path/path.c
+7
-6
No files found.
ccan/tal/path/path.c
View file @
e16aa40b
...
@@ -302,7 +302,7 @@ fail_take_to:
...
@@ -302,7 +302,7 @@ fail_take_to:
char
*
path_readlink
(
const
tal_t
*
ctx
,
const
char
*
linkname
)
char
*
path_readlink
(
const
tal_t
*
ctx
,
const
char
*
linkname
)
{
{
ssize_t
len
,
maxlen
=
64
;
/* good first guess. */
ssize_t
maxlen
=
64
;
/* good first guess. */
char
*
ret
=
NULL
;
char
*
ret
=
NULL
;
if
(
unlikely
(
!
linkname
)
&&
is_taken
(
linkname
))
if
(
unlikely
(
!
linkname
)
&&
is_taken
(
linkname
))
...
@@ -311,19 +311,20 @@ fail_take_to:
...
@@ -311,19 +311,20 @@ fail_take_to:
ret
=
tal_arr
(
ctx
,
char
,
maxlen
+
1
);
ret
=
tal_arr
(
ctx
,
char
,
maxlen
+
1
);
while
(
ret
)
{
while
(
ret
)
{
len
=
readlink
(
linkname
,
ret
,
maxlen
);
ssize_t
len
=
readlink
(
linkname
,
ret
,
maxlen
);
if
(
len
<
0
)
if
(
len
<
0
)
goto
fail
;
goto
fail
;
if
(
len
<
maxlen
)
if
(
len
<
maxlen
)
{
ret
[
len
]
=
'\0'
;
break
;
break
;
}
if
(
!
tal_resize
(
&
ret
,
maxlen
*=
2
+
1
))
if
(
!
tal_resize
(
&
ret
,
maxlen
*=
2
+
1
))
goto
fail
;
goto
fail
;
}
}
if
(
ret
)
ret
[
len
]
=
'\0'
;
out:
out:
if
(
taken
(
linkname
))
if
(
taken
(
linkname
))
tal_free
(
linkname
);
tal_free
(
linkname
);
...
...
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