diff options
Diffstat (limited to 'apps/cuesheet.c')
-rw-r--r-- | apps/cuesheet.c | 16 |
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) | |||
127 | 127 | ||
128 | /* Look for a Unicode BOM */ | 128 | /* Look for a Unicode BOM */ |
129 | unsigned char bom_read = 0; | 129 | unsigned char bom_read = 0; |
130 | read(fd, line, 3); | 130 | read(fd, line, BOM_UTF_8_SIZE); |
131 | if(!memcmp(line, "\xef\xbb\xbf", 3)) | 131 | if(!memcmp(line, BOM_UTF_8, BOM_UTF_8_SIZE)) |
132 | { | 132 | { |
133 | char_enc = CHAR_ENC_UTF_8; | 133 | char_enc = CHAR_ENC_UTF_8; |
134 | bom_read = 3; | 134 | bom_read = BOM_UTF_8_SIZE; |
135 | } | 135 | } |
136 | else if(!memcmp(line, "\xff\xfe", 2)) | 136 | else if(!memcmp(line, BOM_UTF_16_LE, BOM_UTF_16_SIZE)) |
137 | { | 137 | { |
138 | char_enc = CHAR_ENC_UTF_16_LE; | 138 | char_enc = CHAR_ENC_UTF_16_LE; |
139 | bom_read = 2; | 139 | bom_read = BOM_UTF_16_SIZE; |
140 | } | 140 | } |
141 | else if(!memcmp(line, "\xfe\xff", 2)) | 141 | else if(!memcmp(line, BOM_UTF_16_BE, BOM_UTF_16_SIZE)) |
142 | { | 142 | { |
143 | char_enc = CHAR_ENC_UTF_16_BE; | 143 | char_enc = CHAR_ENC_UTF_16_BE; |
144 | bom_read = 2; | 144 | bom_read = BOM_UTF_16_SIZE; |
145 | } | 145 | } |
146 | if (bom_read < 3 ) | 146 | if (bom_read < BOM_UTF_8_SIZE) |
147 | lseek(fd, cue_file->pos + bom_read, SEEK_SET); | 147 | lseek(fd, cue_file->pos + bom_read, SEEK_SET); |
148 | if (is_embedded) | 148 | if (is_embedded) |
149 | { | 149 | { |