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
9352fc9e
Commit
9352fc9e
authored
Aug 29, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tag: pass length to fix_utf8()
Same as the previous patch, prepare the function fix_utf8() this time.
parent
43c389b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
tag.c
src/tag.c
+4
-3
No files found.
src/tag.c
View file @
9352fc9e
...
...
@@ -347,17 +347,18 @@ int tag_equal(struct tag *tag1, struct tag *tag2)
return
1
;
}
static
inline
char
*
fix_utf8
(
char
*
str
)
{
static
inline
char
*
fix_utf8
(
char
*
str
,
size_t
*
length_r
)
{
char
*
temp
;
assert
(
str
!=
NULL
);
if
(
validUtf8String
(
str
,
strlen
(
str
)
))
if
(
validUtf8String
(
str
,
*
length_r
))
return
str
;
DEBUG
(
"not valid utf8 in tag: %s
\n
"
,
str
);
temp
=
latin1StrToUtf8Dup
(
str
);
free
(
str
);
*
length_r
=
strlen
(
temp
);
return
temp
;
}
...
...
@@ -370,7 +371,7 @@ static void appendToTagItems(struct tag *tag, enum tag_type type,
memcpy
(
duplicated
,
value
,
len
);
duplicated
[
len
]
=
'\0'
;
duplicated
=
fix_utf8
(
duplicated
);
duplicated
=
fix_utf8
(
duplicated
,
&
len
);
stripReturnChar
(
duplicated
);
tag
->
numOfItems
++
;
...
...
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