Skip to content

Commit 3054e97

Browse files
committed
Merge pull request #1914 from asottile/fix_charset_unsigned_char
Handle signed char when considering @charset
2 parents 601be96 + e9f4310 commit 3054e97

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/output.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ namespace Sass {
6767
// search for unicode char
6868
for(const char& chr : wbuf.buffer) {
6969
// skip all ascii chars
70-
if (chr >= 0) continue;
70+
// static cast to unsigned to handle `char` being signed / unsigned
71+
if (static_cast<unsigned>(chr) < 128) continue;
7172
// declare the charset
7273
if (output_style() != COMPRESSED)
7374
charset = "@charset \"UTF-8\";"

0 commit comments

Comments
 (0)