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
8cb547f5
Commit
8cb547f5
authored
Oct 01, 2008
by
Rémi Duraffort
Committed by
Derk-Jan Hartman
Oct 02, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove duplication and do the NULL text before dereferencing (CID 232)
(cherry picked from commit
78277aed
)
parent
6b30077e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
src/text/unicode.c
src/text/unicode.c
+3
-6
No files found.
src/text/unicode.c
View file @
8cb547f5
...
@@ -99,6 +99,9 @@ static int find_charset (void)
...
@@ -99,6 +99,9 @@ static int find_charset (void)
static
char
*
locale_fast
(
const
char
*
string
,
bool
from
)
static
char
*
locale_fast
(
const
char
*
string
,
bool
from
)
{
{
if
(
string
==
NULL
)
return
NULL
;
#if defined (USE_ICONV)
#if defined (USE_ICONV)
if
(
find_charset
())
if
(
find_charset
())
return
(
char
*
)
string
;
return
(
char
*
)
string
;
...
@@ -113,9 +116,6 @@ static char *locale_fast (const char *string, bool from)
...
@@ -113,9 +116,6 @@ static char *locale_fast (const char *string, bool from)
size_t
outb
=
inb
*
6
+
1
;
size_t
outb
=
inb
*
6
+
1
;
char
output
[
outb
],
*
optr
=
output
;
char
output
[
outb
],
*
optr
=
output
;
if
(
string
==
NULL
)
return
NULL
;
while
(
vlc_iconv
(
hd
,
&
iptr
,
&
inb
,
&
optr
,
&
outb
)
==
(
size_t
)(
-
1
))
while
(
vlc_iconv
(
hd
,
&
iptr
,
&
inb
,
&
optr
,
&
outb
)
==
(
size_t
)(
-
1
))
{
{
*
optr
++
=
'?'
;
*
optr
++
=
'?'
;
...
@@ -136,9 +136,6 @@ static char *locale_fast (const char *string, bool from)
...
@@ -136,9 +136,6 @@ static char *locale_fast (const char *string, bool from)
char
*
out
;
char
*
out
;
int
len
;
int
len
;
if
(
string
==
NULL
)
return
NULL
;
len
=
1
+
MultiByteToWideChar
(
from
?
CP_ACP
:
CP_UTF8
,
len
=
1
+
MultiByteToWideChar
(
from
?
CP_ACP
:
CP_UTF8
,
0
,
string
,
-
1
,
NULL
,
0
);
0
,
string
,
-
1
,
NULL
,
0
);
wchar_t
wide
[
len
];
wchar_t
wide
[
len
];
...
...
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