Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stefan Strogin
flac
Commits
92285393
Commit
92285393
authored
Aug 09, 2015
by
Erik de Castro Lopo
Browse files
flac/metaflac: Do case-insensitve comparison of hex values
Patch-from: lvqcl <lvqcl.mail@gmail.com>
parent
11230878
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/flac/utils.c
View file @
92285393
...
...
@@ -409,7 +409,7 @@ FLAC__bool flac__utils_get_channel_mask_tag(const FLAC__StreamMetadata *object,
return
false
;
if
(
0
==
(
p
=
strchr
((
const
char
*
)
object
->
data
.
vorbis_comment
.
comments
[
offset
].
entry
,
'='
)))
/* should never happen, but just in case */
return
false
;
if
(
strncmp
(
p
,
"=0x"
,
3
))
if
(
FLAC__STRNCASECMP
(
p
,
"=0x"
,
3
))
return
false
;
if
(
sscanf
(
p
+
3
,
"%x"
,
&
val
)
!=
1
)
return
false
;
...
...
src/metaflac/options.c
View file @
92285393
...
...
@@ -1023,7 +1023,7 @@ FLAC__bool parse_block_type(const char *in, Argument_BlockType *out)
if
(
strlen
(
r
)
==
sizeof
(
out
->
entries
[
entry
].
application_id
))
{
memcpy
(
out
->
entries
[
entry
].
application_id
,
r
,
sizeof
(
out
->
entries
[
entry
].
application_id
));
}
else
if
(
strlen
(
r
)
==
10
&&
strncmp
(
r
,
"0x"
,
2
)
==
0
&&
strspn
(
r
+
2
,
"0123456789ABCDEFabcdef"
)
==
8
)
{
else
if
(
strlen
(
r
)
==
10
&&
FLAC__STRNCASECMP
(
r
,
"0x"
,
2
)
==
0
&&
strspn
(
r
+
2
,
"0123456789ABCDEFabcdef"
)
==
8
)
{
FLAC__uint32
x
=
strtoul
(
r
+
2
,
0
,
16
);
out
->
entries
[
entry
].
application_id
[
3
]
=
(
FLAC__byte
)(
x
&
0xff
);
out
->
entries
[
entry
].
application_id
[
2
]
=
(
FLAC__byte
)((
x
>>=
8
)
&
0xff
);
...
...
Write
Preview
Supports
Markdown
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