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
1d385190
Commit
1d385190
authored
Oct 20, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
path: removed pathcpy_trunc()
There was only one user of pathcpy_trunc(), which can be eliminated.
parent
49260e6d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
24 deletions
+2
-24
decoder_thread.c
src/decoder_thread.c
+2
-5
path.c
src/path.c
+0
-13
path.h
src/path.h
+0
-6
No files found.
src/decoder_thread.c
View file @
1d385190
...
...
@@ -39,11 +39,8 @@ static void decodeStart(void)
if
(
song_is_file
(
song
))
map_song_fs
(
song
,
path_max_fs
);
else
{
char
path_max_utf8
[
MPD_PATH_MAX
];
song_get_url
(
song
,
path_max_utf8
);
pathcpy_trunc
(
path_max_fs
,
path_max_utf8
);
}
else
song_get_url
(
song
,
path_max_fs
);
dc
.
current_song
=
dc
.
next_song
;
/* NEED LOCK */
if
(
openInputStream
(
&
inStream
,
path_max_fs
)
<
0
)
{
...
...
src/path.c
View file @
1d385190
...
...
@@ -189,19 +189,6 @@ char *rpp2app_r(char *dst, const char *rel_path)
return
dst
;
}
/* this is actually like strlcpy (OpenBSD), but we don't actually want to
* blindly use it everywhere, only for paths that are OK to truncate (for
* error reporting and such */
void
pathcpy_trunc
(
char
*
dest
,
const
char
*
src
)
{
size_t
len
=
strlen
(
src
);
if
(
mpd_unlikely
(
len
>=
MPD_PATH_MAX
))
len
=
MPD_PATH_MAX
-
1
;
memcpy
(
dest
,
src
,
len
);
dest
[
len
]
=
'\0'
;
}
char
*
sanitizePathDup
(
const
char
*
path
)
{
int
len
=
strlen
(
path
)
+
1
;
...
...
src/path.h
View file @
1d385190
...
...
@@ -61,12 +61,6 @@ char *rpp2app_r(char *dst, const char *rel_path);
/* strips extra "///" and leading "/" and trailing "/" */
char
*
sanitizePathDup
(
const
char
*
path
);
/* this is actually like strlcpy (OpenBSD), but we don't actually want to
* blindly use it everywhere, only for paths that are OK to truncate (for
* error reporting and such.
* dest must be MPD_PATH_MAX bytes large (which is standard in mpd) */
void
pathcpy_trunc
(
char
*
dest
,
const
char
*
src
);
/*
* converts a path passed from a client into an absolute FS path.
* paths passed by clients do NOT have file suffixes in them
...
...
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