Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
eea72674
Commit
eea72674
authored
Jul 25, 2011
by
Jonathan Neuschäfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/raop: rewrite remove_char_from_string
parent
0ea4c970
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
raop_output_plugin.c
src/output/raop_output_plugin.c
+15
-14
No files found.
src/output/raop_output_plugin.c
View file @
eea72674
...
@@ -182,21 +182,22 @@ kd_lookup(struct key_data *kd, const char *key)
...
@@ -182,21 +182,22 @@ kd_lookup(struct key_data *kd, const char *key)
* return the number of deleted characters
* return the number of deleted characters
*/
*/
static
int
static
int
remove_char_from_string
(
char
*
str
,
char
r
c
)
remove_char_from_string
(
char
*
str
,
char
c
)
{
{
int
i
=
0
,
j
=
0
,
len
;
char
*
src
,
*
dst
;
int
num
=
0
;
len
=
strlen
(
str
);
/* skip all characters that don't need to be copied */
while
(
i
<
len
)
{
src
=
strchr
(
str
,
c
);
if
(
str
[
i
]
==
rc
)
{
if
(
!
src
)
for
(
j
=
i
;
j
<
len
;
j
++
)
str
[
j
]
=
str
[
j
+
1
];
return
0
;
len
--
;
num
++
;
for
(
dst
=
src
;
*
src
;
src
++
)
}
else
{
if
(
*
src
!=
c
)
i
++
;
*
(
dst
++
)
=
*
src
;
}
}
*
dst
=
'\0'
;
return
num
;
return
src
-
dst
;
}
}
#define SLEEP_MSEC(val) usleep(val*1000)
#define SLEEP_MSEC(val) usleep(val*1000)
...
...
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