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
bc1506a1
Commit
bc1506a1
authored
Oct 23, 2010
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not use strlen just to check that a string is non-empty.
parent
79943f01
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
11 deletions
+11
-11
modules/gui/qt4/components/simple_preferences.cpp
modules/gui/qt4/components/simple_preferences.cpp
+1
-1
modules/mux/mpeg/ts.c
modules/mux/mpeg/ts.c
+2
-2
modules/video_filter/atmo/AtmoMultiConnection.cpp
modules/video_filter/atmo/AtmoMultiConnection.cpp
+2
-2
modules/video_filter/atmo/atmo.cpp
modules/video_filter/atmo/atmo.cpp
+6
-6
No files found.
modules/gui/qt4/components/simple_preferences.cpp
View file @
bc1506a1
...
...
@@ -1004,7 +1004,7 @@ void addAsso( QVLCRegistry *qvReg, const char *psz_ext )
/* Save a backup if already assigned */
char
*
psz_value
=
qvReg
->
ReadRegistryString
(
psz_ext
,
""
,
""
);
if
(
psz_value
&&
strlen
(
psz_value
)
>
0
)
if
(
!
EMPTY_STR
(
psz_value
)
)
qvReg
->
WriteRegistryString
(
psz_ext
,
"VLC.backup"
,
psz_value
);
delete
psz_value
;
...
...
modules/mux/mpeg/ts.c
View file @
bc1506a1
...
...
@@ -546,7 +546,7 @@ static int Open( vlc_object_t *p_this )
{
i_pid
=
strtoul
(
psz
,
&
psz_next
,
0
);
if
(
strlen
(
psz_next
)
>
0
)
if
(
psz_next
[
0
]
!=
'\0'
)
psz
=
&
psz_next
[
1
];
if
(
i_pid
==
0
)
{
...
...
@@ -665,7 +665,7 @@ static int Open( vlc_object_t *p_this )
while
(
psz
!=
NULL
)
{
i_pid
=
strtoul
(
psz
,
&
psz_next
,
0
);
if
(
strlen
(
psz_next
)
>
0
)
if
(
psz_next
[
0
]
!=
'\0'
)
psz
=
&
psz_next
[
1
];
else
psz
=
NULL
;
...
...
modules/video_filter/atmo/AtmoMultiConnection.cpp
View file @
bc1506a1
...
...
@@ -95,7 +95,7 @@ ATMO_BOOL CAtmoMultiConnection::OpenConnection()
for
(
int
c
=
0
;
c
<
4
;
c
++
)
{
char
*
devName
=
m_pAtmoConfig
->
getSerialDevice
(
c
);
if
(
devName
&&
strlen
(
devName
)
>
0
)
if
(
!
EMPTY_STR
(
devName
)
)
{
m_hComports
[
z
]
=
OpenDevice
(
devName
);
if
(
m_hComports
[
z
]
==
INVALID_HANDLE_VALUE
)
{
...
...
@@ -168,7 +168,7 @@ int CAtmoMultiConnection::getNumChannels()
char
*
psz_dev
;
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
psz_dev
=
m_pAtmoConfig
->
getSerialDevice
(
i
);
if
(
psz_dev
&&
strlen
(
psz_dev
)
>
0
)
if
(
!
EMPTY_STR
(
psz_dev
)
)
z
+=
4
;
}
#else
...
...
modules/video_filter/atmo/atmo.cpp
View file @
bc1506a1
...
...
@@ -1232,7 +1232,7 @@ static void Atmo_SetupBuildZones(filter_t *p_filter)
p_filter
,
CFG_PREFIX
"channels"
);
if
(
psz_channels
&&
strlen
(
psz_channels
)
>
0
)
if
(
!
EMPTY_STR
(
psz_channels
)
)
{
msg_Dbg
(
p_filter
,
"deal with new zone mapping %s"
,
psz_channels
);
int
channel
=
0
;
...
...
@@ -1316,7 +1316,7 @@ static void Atmo_SetupBuildZones(filter_t *p_filter)
p_filter
,
psz_gradient_var_name
);
if
(
psz_gradient_file
&&
strlen
(
psz_gradient_file
)
>
0
)
if
(
!
EMPTY_STR
(
psz_gradient_file
)
)
{
msg_Dbg
(
p_filter
,
"loading gradientfile %s for "
\
"zone %d"
,
psz_gradient_file
,
i
);
...
...
@@ -1348,7 +1348,7 @@ static void Atmo_SetupBuildZones(filter_t *p_filter)
p_filter
,
CFG_PREFIX
"gradient_path"
);
if
(
psz_gradient_path
&&
strlen
(
psz_gradient_path
)
>
0
)
if
(
EMPTY_STR
(
psz_gradient_path
)
)
{
char
*
psz_file_name
=
(
char
*
)
malloc
(
strlen
(
psz_gradient_path
)
+
16
);
assert
(
psz_file_name
);
...
...
@@ -1397,7 +1397,7 @@ static void Atmo_SetupConfig(filter_t *p_filter, CAtmoConfig *p_atmo_config)
CFG_PREFIX
"serialdev"
);
char
*
psz_temp
=
psz_serialdev
;
if
(
psz_temp
&&
strlen
(
psz_temp
)
>
0
)
if
(
!
EMPTY_STR
(
psz_serialdev
)
)
{
char
*
psz_token
;
int
i_port
=
0
;
...
...
@@ -1528,7 +1528,7 @@ static void Atmo_SetupConfig(filter_t *p_filter, CAtmoConfig *p_atmo_config)
char
*
psz_chbase
=
var_CreateGetStringCommand
(
p_filter
,
CFG_PREFIX
"dmx-chbase"
);
if
(
psz_chbase
&&
strlen
(
psz_chbase
)
>
0
)
if
(
!
EMPTY_STR
(
psz_chbase
)
)
p_atmo_config
->
setDMX_BaseChannels
(
psz_chbase
);
free
(
psz_chbase
);
...
...
@@ -1598,7 +1598,7 @@ static void Atmo_SetupParameters(filter_t *p_filter)
*/
char
*
psz_path
=
var_CreateGetStringCommand
(
p_filter
,
CFG_PREFIX
"atmowinexe"
);
if
(
psz_path
&&
strlen
(
psz_path
)
>
0
)
if
(
!
EMPTY_STR
(
psz_path
)
)
{
char
*
psz_bs
=
strrchr
(
psz_path
,
'\\'
);
if
(
psz_bs
)
...
...
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