mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
unicode: add utf16decode with utf8 buffer size check
Make use of it in id3tags and cuesheet Change-Id: I153c23f1f7312e9d5e1de9f03725f2d2ab0abc93
This commit is contained in:
parent
e334a1f95e
commit
1f548f74e6
4 changed files with 34 additions and 42 deletions
|
@ -265,7 +265,7 @@ bool parse_cuesheet(struct cuesheet_file *cue_file, struct cuesheet *cue)
|
|||
{
|
||||
if (char_enc == CHAR_ENC_UTF_16_LE)
|
||||
{
|
||||
s = utf16LEdecode(line, utf16_buf, line_len);
|
||||
s = utf16decode(line, utf16_buf, line_len>>1, sizeof(utf16_buf) - 1, true);
|
||||
/* terminate the string at the newline */
|
||||
*s = '\0';
|
||||
strcpy(line, utf16_buf);
|
||||
|
@ -275,7 +275,7 @@ bool parse_cuesheet(struct cuesheet_file *cue_file, struct cuesheet *cue)
|
|||
}
|
||||
else if (char_enc == CHAR_ENC_UTF_16_BE)
|
||||
{
|
||||
s = utf16BEdecode(line, utf16_buf, line_len);
|
||||
s = utf16decode(line, utf16_buf, line_len>>1, sizeof(utf16_buf) - 1, false);
|
||||
*s = '\0';
|
||||
strcpy(line, utf16_buf);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue