Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
6e335604
Commit
6e335604
authored
Nov 21, 2018
by
Uwe Schulzweida
Browse files
Replace strStartsWith() and strcmp() by strIsEqual().
parent
3ce4c9ca
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
src/cdf_util.c
View file @
6e335604
...
...
@@ -19,10 +19,10 @@ char *strToLower(char *str)
bool
strStartsWith
(
const
char
*
vstr
,
const
char
*
cstr
)
{
bool
is_equal
=
false
;
if
(
vstr
&&
*
v
str
)
if
(
vstr
&&
c
str
)
{
size_t
clen
=
(
cstr
!=
NULL
)
?
strlen
(
cstr
)
:
0
;
size_t
vlen
=
(
vstr
!=
NULL
)
?
strlen
(
vstr
)
:
0
;
size_t
clen
=
strlen
(
cstr
);
size_t
vlen
=
strlen
(
vstr
);
if
(
clen
<=
vlen
)
is_equal
=
(
memcmp
(
vstr
,
cstr
,
clen
)
==
0
);
}
return
is_equal
;
...
...
src/cdi_int.h
View file @
6e335604
...
...
@@ -41,6 +41,13 @@ char *strdup(const char *s);
char
*
strToLower
(
char
*
str
);
bool
strStartsWith
(
const
char
*
vstr
,
const
char
*
cstr
);
inline
bool
strIsEqual
(
const
char
*
x
,
const
char
*
y
)
{
return
(
*
x
==
*
y
)
&&
strcmp
(
x
,
y
)
==
0
;
}
#ifndef M_PI
#define M_PI 3.14159265358979323846
/* pi */
#endif
...
...
src/stream_cdf_i.c
View file @
6e335604
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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