Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
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
Hide 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 )
...
@@ -1004,7 +1004,7 @@ void addAsso( QVLCRegistry *qvReg, const char *psz_ext )
/* Save a backup if already assigned */
/* Save a backup if already assigned */
char
*
psz_value
=
qvReg
->
ReadRegistryString
(
psz_ext
,
""
,
""
);
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
);
qvReg
->
WriteRegistryString
(
psz_ext
,
"VLC.backup"
,
psz_value
);
delete
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 )
...
@@ -546,7 +546,7 @@ static int Open( vlc_object_t *p_this )
{
{
i_pid
=
strtoul
(
psz
,
&
psz_next
,
0
);
i_pid
=
strtoul
(
psz
,
&
psz_next
,
0
);
if
(
strlen
(
psz_next
)
>
0
)
if
(
psz_next
[
0
]
!=
'\0'
)
psz
=
&
psz_next
[
1
];
psz
=
&
psz_next
[
1
];
if
(
i_pid
==
0
)
if
(
i_pid
==
0
)
{
{
...
@@ -665,7 +665,7 @@ static int Open( vlc_object_t *p_this )
...
@@ -665,7 +665,7 @@ static int Open( vlc_object_t *p_this )
while
(
psz
!=
NULL
)
while
(
psz
!=
NULL
)
{
{
i_pid
=
strtoul
(
psz
,
&
psz_next
,
0
);
i_pid
=
strtoul
(
psz
,
&
psz_next
,
0
);
if
(
strlen
(
psz_next
)
>
0
)
if
(
psz_next
[
0
]
!=
'\0'
)
psz
=
&
psz_next
[
1
];
psz
=
&
psz_next
[
1
];
else
else
psz
=
NULL
;
psz
=
NULL
;
...
...
modules/video_filter/atmo/AtmoMultiConnection.cpp
View file @
bc1506a1
...
@@ -95,7 +95,7 @@ ATMO_BOOL CAtmoMultiConnection::OpenConnection()
...
@@ -95,7 +95,7 @@ ATMO_BOOL CAtmoMultiConnection::OpenConnection()
for
(
int
c
=
0
;
c
<
4
;
c
++
)
{
for
(
int
c
=
0
;
c
<
4
;
c
++
)
{
char
*
devName
=
m_pAtmoConfig
->
getSerialDevice
(
c
);
char
*
devName
=
m_pAtmoConfig
->
getSerialDevice
(
c
);
if
(
devName
&&
strlen
(
devName
)
>
0
)
if
(
!
EMPTY_STR
(
devName
)
)
{
{
m_hComports
[
z
]
=
OpenDevice
(
devName
);
m_hComports
[
z
]
=
OpenDevice
(
devName
);
if
(
m_hComports
[
z
]
==
INVALID_HANDLE_VALUE
)
{
if
(
m_hComports
[
z
]
==
INVALID_HANDLE_VALUE
)
{
...
@@ -168,7 +168,7 @@ int CAtmoMultiConnection::getNumChannels()
...
@@ -168,7 +168,7 @@ int CAtmoMultiConnection::getNumChannels()
char
*
psz_dev
;
char
*
psz_dev
;
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
psz_dev
=
m_pAtmoConfig
->
getSerialDevice
(
i
);
psz_dev
=
m_pAtmoConfig
->
getSerialDevice
(
i
);
if
(
psz_dev
&&
strlen
(
psz_dev
)
>
0
)
if
(
!
EMPTY_STR
(
psz_dev
)
)
z
+=
4
;
z
+=
4
;
}
}
#else
#else
...
...
modules/video_filter/atmo/atmo.cpp
View file @
bc1506a1
...
@@ -1232,7 +1232,7 @@ static void Atmo_SetupBuildZones(filter_t *p_filter)
...
@@ -1232,7 +1232,7 @@ static void Atmo_SetupBuildZones(filter_t *p_filter)
p_filter
,
p_filter
,
CFG_PREFIX
"channels"
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
);
msg_Dbg
(
p_filter
,
"deal with new zone mapping %s"
,
psz_channels
);
int
channel
=
0
;
int
channel
=
0
;
...
@@ -1316,7 +1316,7 @@ static void Atmo_SetupBuildZones(filter_t *p_filter)
...
@@ -1316,7 +1316,7 @@ static void Atmo_SetupBuildZones(filter_t *p_filter)
p_filter
,
p_filter
,
psz_gradient_var_name
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 "
\
msg_Dbg
(
p_filter
,
"loading gradientfile %s for "
\
"zone %d"
,
psz_gradient_file
,
i
);
"zone %d"
,
psz_gradient_file
,
i
);
...
@@ -1348,7 +1348,7 @@ static void Atmo_SetupBuildZones(filter_t *p_filter)
...
@@ -1348,7 +1348,7 @@ static void Atmo_SetupBuildZones(filter_t *p_filter)
p_filter
,
p_filter
,
CFG_PREFIX
"gradient_path"
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
);
char
*
psz_file_name
=
(
char
*
)
malloc
(
strlen
(
psz_gradient_path
)
+
16
);
assert
(
psz_file_name
);
assert
(
psz_file_name
);
...
@@ -1397,7 +1397,7 @@ static void Atmo_SetupConfig(filter_t *p_filter, CAtmoConfig *p_atmo_config)
...
@@ -1397,7 +1397,7 @@ static void Atmo_SetupConfig(filter_t *p_filter, CAtmoConfig *p_atmo_config)
CFG_PREFIX
"serialdev"
);
CFG_PREFIX
"serialdev"
);
char
*
psz_temp
=
psz_serialdev
;
char
*
psz_temp
=
psz_serialdev
;
if
(
psz_temp
&&
strlen
(
psz_temp
)
>
0
)
if
(
!
EMPTY_STR
(
psz_serialdev
)
)
{
{
char
*
psz_token
;
char
*
psz_token
;
int
i_port
=
0
;
int
i_port
=
0
;
...
@@ -1528,7 +1528,7 @@ static void Atmo_SetupConfig(filter_t *p_filter, CAtmoConfig *p_atmo_config)
...
@@ -1528,7 +1528,7 @@ static void Atmo_SetupConfig(filter_t *p_filter, CAtmoConfig *p_atmo_config)
char
*
psz_chbase
=
var_CreateGetStringCommand
(
p_filter
,
char
*
psz_chbase
=
var_CreateGetStringCommand
(
p_filter
,
CFG_PREFIX
"dmx-chbase"
);
CFG_PREFIX
"dmx-chbase"
);
if
(
psz_chbase
&&
strlen
(
psz_chbase
)
>
0
)
if
(
!
EMPTY_STR
(
psz_chbase
)
)
p_atmo_config
->
setDMX_BaseChannels
(
psz_chbase
);
p_atmo_config
->
setDMX_BaseChannels
(
psz_chbase
);
free
(
psz_chbase
);
free
(
psz_chbase
);
...
@@ -1598,7 +1598,7 @@ static void Atmo_SetupParameters(filter_t *p_filter)
...
@@ -1598,7 +1598,7 @@ static void Atmo_SetupParameters(filter_t *p_filter)
*/
*/
char
*
psz_path
=
var_CreateGetStringCommand
(
p_filter
,
char
*
psz_path
=
var_CreateGetStringCommand
(
p_filter
,
CFG_PREFIX
"atmowinexe"
);
CFG_PREFIX
"atmowinexe"
);
if
(
psz_path
&&
strlen
(
psz_path
)
>
0
)
if
(
!
EMPTY_STR
(
psz_path
)
)
{
{
char
*
psz_bs
=
strrchr
(
psz_path
,
'\\'
);
char
*
psz_bs
=
strrchr
(
psz_path
,
'\\'
);
if
(
psz_bs
)
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