summaryrefslogtreecommitdiffstats
path: root/apps/cuesheet.c
diff options
context:
space:
mode:
authorNick Peskett <rockbox@peskett.co.uk>2011-12-20 08:15:36 +0000
committerNick Peskett <rockbox@peskett.co.uk>2011-12-20 08:15:36 +0000
commit1b781df59c1b61009f36b64876372a00411b8be0 (patch)
treedf4b5cceeadf560f084d43d683ebaab689fa805e /apps/cuesheet.c
parentc24a36dd9d54f4f77fb40b63fba1c76bac764aa6 (diff)
downloadrockbox-1b781df59c1b61009f36b64876372a00411b8be0.tar.gz
rockbox-1b781df59c1b61009f36b64876372a00411b8be0.tar.bz2
rockbox-1b781df59c1b61009f36b64876372a00411b8be0.zip
Convert hard-coded unicode byte order mark values to constants.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31374 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/cuesheet.c')
-rw-r--r--apps/cuesheet.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/apps/cuesheet.c b/apps/cuesheet.c
index ab4063a66a..2c2567b391 100644
--- a/apps/cuesheet.c
+++ b/apps/cuesheet.c
@@ -127,23 +127,23 @@ bool parse_cuesheet(struct cuesheet_file *cue_file, struct cuesheet *cue)
/* Look for a Unicode BOM */
unsigned char bom_read = 0;
- read(fd, line, 3);
- if(!memcmp(line, "\xef\xbb\xbf", 3))
+ read(fd, line, BOM_UTF_8_SIZE);
+ if(!memcmp(line, BOM_UTF_8, BOM_UTF_8_SIZE))
{
char_enc = CHAR_ENC_UTF_8;
- bom_read = 3;
+ bom_read = BOM_UTF_8_SIZE;
}
- else if(!memcmp(line, "\xff\xfe", 2))
+ else if(!memcmp(line, BOM_UTF_16_LE, BOM_UTF_16_SIZE))
{
char_enc = CHAR_ENC_UTF_16_LE;
- bom_read = 2;
+ bom_read = BOM_UTF_16_SIZE;
}
- else if(!memcmp(line, "\xfe\xff", 2))
+ else if(!memcmp(line, BOM_UTF_16_BE, BOM_UTF_16_SIZE))
{
char_enc = CHAR_ENC_UTF_16_BE;
- bom_read = 2;
+ bom_read = BOM_UTF_16_SIZE;
}
- if (bom_read < 3 )
+ if (bom_read < BOM_UTF_8_SIZE)
lseek(fd, cue_file->pos + bom_read, SEEK_SET);
if (is_embedded)
{