projects
/
lms
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve code reusage: string strip and free functions.
[lms]
/
lightmediascanner
/
src
/
plugins
/
id3lib
/
id3lib.cpp
diff --git
a/lightmediascanner/src/plugins/id3lib/id3lib.cpp
b/lightmediascanner/src/plugins/id3lib/id3lib.cpp
index
d71bd1d
..
e7680e7
100644
(file)
--- a/
lightmediascanner/src/plugins/id3lib/id3lib.cpp
+++ b/
lightmediascanner/src/plugins/id3lib/id3lib.cpp
@@
-61,14
+61,7
@@
_id3lib_get_string(const ID3_Frame *frame, ID3_FieldID field_id, struct lms_stri
size++;
s->str = (char *)malloc(size * sizeof(char));
s->len = field->Get(s->str, size);
size++;
s->str = (char *)malloc(size * sizeof(char));
s->len = field->Get(s->str, size);
- if (s->len > 0)
- lms_strstrip(s->str, &s->len);
-
- if (s->len < 1) {
- free(s->str);
- s->str = NULL;
- s->len = 0;
- }
+ lms_string_size_strip_and_free(s);
done:
field->SetEncoding(enc);
done:
field->SetEncoding(enc);