Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
videolan
vlc
Commits
d1e140e0
Commit
d1e140e0
authored
Oct 12, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add xstrdup()
parent
cf98594d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
include/vlc_common.h
include/vlc_common.h
+8
-0
src/config/core.c
src/config/core.c
+2
-4
No files found.
include/vlc_common.h
View file @
d1e140e0
...
...
@@ -889,6 +889,14 @@ static inline void *xcalloc (size_t n, size_t size)
return
ptr
;
}
static
inline
char
*
xstrdup
(
const
char
*
str
)
{
char
*
ptr
=
strdup
(
str
);
if
(
unlikely
(
ptr
==
NULL
))
abort
();
return
ptr
;
}
/*****************************************************************************
* libvlc features
*****************************************************************************/
...
...
src/config/core.c
View file @
d1e140e0
...
...
@@ -414,12 +414,10 @@ ssize_t config_GetPszChoices (vlc_object_t *obj, const char *name,
for
(
size_t
i
=
0
;
i
<
count
;
i
++
)
{
vals
[
i
]
=
strdup
((
cfg
->
list
.
psz
[
i
]
!=
NULL
)
?
cfg
->
list
.
psz
[
i
]
:
""
);
vals
[
i
]
=
x
strdup
((
cfg
->
list
.
psz
[
i
]
!=
NULL
)
?
cfg
->
list
.
psz
[
i
]
:
""
);
/* FIXME: use module_gettext() instead */
txts
[
i
]
=
strdup
((
cfg
->
list_text
[
i
]
!=
NULL
)
txts
[
i
]
=
x
strdup
((
cfg
->
list_text
[
i
]
!=
NULL
)
?
vlc_gettext
(
cfg
->
list_text
[
i
])
:
""
);
if
(
unlikely
(
vals
[
i
]
==
NULL
||
txts
[
i
]
==
NULL
))
abort
();
}
*
values
=
vals
;
...
...
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