Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: A typo in apps/metadata/id3tags.c, r31321 ?

Re: A typo in apps/metadata/id3tags.c, r31321 ?

From: Nick Peskett <rockbox_at_peskett.co.uk>
Date: Sat, 17 Dec 2011 23:27:21 +0000

On 17/12/2011 15:19, Al Le wrote:
> Is it a typo or an intended code (it occurs twice)?
>
> cuesheet_offset += cuesheet_offset+1;
>
> Shouldn't it be "cuesheet_offset += 1;"?
>
> Or is the code correct because it is in the branch for UTF16, i.e. two
> bytes per character?
>
> I'm just asking for the case.

It's intended code.

For single byte encodings, we have (space is really \0 for the cuesheet
string in these examples);

[enc type] [CUESHEET ]
1 +9 =10

For double byte encodings;

[enc type] [bom] [ C U E S H E E T ]
1 +2 +18 = 21

So;

10 += 10+1

Maybe I just should have written "cuesheet_offset = 21;", it's not going
to change. Force of habit I suppose.

Cheers,

Nick
Received on 2011-12-18


Page was last modified "Jan 10 2012" The Rockbox Crew
aaa