summaryrefslogtreecommitdiffstats
path: root/src/util.cpp
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2018-08-10 08:14:47 (GMT)
committeralbert-github <albert.tests@gmail.com>2018-08-10 08:14:47 (GMT)
commitf3b423989086728ded99492e61a0a5c127f21f69 (patch)
treec8a179c5f994f9760b23de4334784e0286251ed4 /src/util.cpp
parent69829b043fb36a56d194dc31522b694379636855 (diff)
downloadDoxygen-f3b423989086728ded99492e61a0a5c127f21f69.zip
Doxygen-f3b423989086728ded99492e61a0a5c127f21f69.tar.gz
Doxygen-f3b423989086728ded99492e61a0a5c127f21f69.tar.bz2
Automatic detection of UCS-2 based on BOM corrected
Based on the travis messages (in total 4): /home/travis/build/doxygen/doxygen/src/util.cpp:7952:20: warning: comparison of constant -1 with expression of type 'char' is always false [-Wtautological-constant-out-of-range-compare] ((inBuf.at(0)==-1 && inBuf.at(1)==-2) || // Little endian BOM ~~~~~~~~~~~^ ~~ and subsequent tests, the automatic detection of the UCS-2 BOM failed, this has been corected.
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 6c7e3d5..b387a84 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -7949,8 +7949,8 @@ bool readInputFile(const char *fileName,BufStr &inBuf,bool filter,bool isSourceC
int start=0;
if (size>=2 &&
- ((inBuf.at(0)==-1 && inBuf.at(1)==-2) || // Little endian BOM
- (inBuf.at(0)==-2 && inBuf.at(1)==-1) // big endian BOM
+ (((uchar)inBuf.at(0)==0xFF && (uchar)inBuf.at(1)==0xFE) || // Little endian BOM
+ ((uchar)inBuf.at(0)==0xFE && (uchar)inBuf.at(1)==0xFF) // big endian BOM
)
) // UCS-2 encoded file
{