Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 486948
Collapse All | Expand All

(-)/icu/trunk/source/i18n/csrucode.cpp (-4 / +6 lines)
Lines 1-5 Link Here
1
/*
1
/*
2
 **********************************************************************
2
 **********************************************************************
3
 *   Copyright (C) 2005-2012, International Business Machines
3
 *   Copyright (C) 2005-2013, International Business Machines
4
 *   Corporation and others.  All Rights Reserved.
4
 *   Corporation and others.  All Rights Reserved.
5
 **********************************************************************
5
 **********************************************************************
Lines 34-39 Link Here
34
    const uint8_t *input = textIn->fRawInput;
34
    const uint8_t *input = textIn->fRawInput;
35
    int32_t confidence = 0;
35
    int32_t confidence = 0;
36
    int32_t length = textIn->fRawLength;
36
37
37
    if (input[0] == 0xFE && input[1] == 0xFF) {
38
    if (length >=2 && input[0] == 0xFE && input[1] == 0xFF) {
38
        confidence = 100;
39
        confidence = 100;
39
    }
40
    }
Lines 58-63 Link Here
58
    const uint8_t *input = textIn->fRawInput;
59
    const uint8_t *input = textIn->fRawInput;
59
    int32_t confidence = 0;
60
    int32_t confidence = 0;
61
    int32_t length = textIn->fRawLength;
60
62
61
    if (input[0] == 0xFF && input[1] == 0xFE && (input[2] != 0x00 || input[3] != 0x00)) {
63
    if (length >= 4 && input[0] == 0xFF && input[1] == 0xFE && (input[2] != 0x00 || input[3] != 0x00)) {
62
        confidence = 100;
64
        confidence = 100;
63
    }
65
    }
Lines 82-86 Link Here
82
    int32_t confidence = 0;
84
    int32_t confidence = 0;
83
85
84
    if (getChar(input, 0) == 0x0000FEFFUL) {
86
    if (limit > 0 && getChar(input, 0) == 0x0000FEFFUL) {
85
        hasBOM = TRUE;
87
        hasBOM = TRUE;
86
    }
88
    }

Return to bug 486948