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
0d34815f
Commit
0d34815f
authored
Oct 07, 2008
by
Eric Wong
Committed by
Max Kellermann
Oct 07, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Assert if we don't have song or song->url set
song objects cannot exist without a path or URL
parent
016af692
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
directory.c
src/directory.c
+2
-2
song.c
src/song.c
+8
-2
No files found.
src/directory.c
View file @
0d34815f
...
...
@@ -298,8 +298,8 @@ removeDeletedFromDirectory(char *path_max_tmp, Directory * directory)
for
(
i
=
sv
->
nr
;
--
i
>=
0
;
)
{
/* cleaner deletes if we go backwards */
Song
*
song
=
sv
->
base
[
i
];
if
(
!
song
||
!*
song
->
url
)
continue
;
/* does this happen?, perhaps assert() */
assert
(
song
);
assert
(
*
song
->
url
);
if
(
dirname
)
sprintf
(
path_max_tmp
,
"%s/%s"
,
dirname
,
song
->
url
);
...
...
src/song.c
View file @
0d34815f
...
...
@@ -31,8 +31,13 @@
Song
*
song_alloc
(
const
char
*
url
,
struct
_Directory
*
parent
)
{
size_t
urllen
=
strlen
(
url
);
Song
*
song
=
xmalloc
(
sizeof
(
*
song
)
-
sizeof
(
song
->
url
)
+
urllen
+
1
);
size_t
urllen
;
Song
*
song
;
assert
(
url
);
urllen
=
strlen
(
url
);
assert
(
urllen
);
song
=
xmalloc
(
sizeof
(
*
song
)
-
sizeof
(
song
->
url
)
+
urllen
+
1
);
song
->
tag
=
NULL
;
memcpy
(
song
->
url
,
url
,
urllen
+
1
);
...
...
@@ -44,6 +49,7 @@ song_alloc(const char *url, struct _Directory *parent)
Song
*
newSong
(
const
char
*
url
,
Directory
*
parentDir
)
{
Song
*
song
;
assert
(
*
url
);
if
(
strchr
(
url
,
'\n'
))
{
DEBUG
(
"newSong: '%s' is not a valid uri
\n
"
,
url
);
...
...
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