From e9b609bf9ae301eb415227e76b6ae904881c07eb Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 13 Aug 2014 19:00:07 +0200 Subject: nix-log2xml: Handle UTF-8 characters C++ chars can be negative... --- src/nix-log2xml/log2xml.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nix-log2xml') diff --git a/src/nix-log2xml/log2xml.cc b/src/nix-log2xml/log2xml.cc index 6645dc500..e26fb0023 100644 --- a/src/nix-log2xml/log2xml.cc +++ b/src/nix-log2xml/log2xml.cc @@ -137,7 +137,7 @@ void Decoder::finishLine() if (line[i] == '<') cout << "<"; else if (line[i] == '&') cout << "&"; else if (line[i] == '\r') ; /* ignore carriage return */ - else if (line[i] < 32 && line[i] != 9) cout << "�"; + else if (line[i] >= 0 && line[i] < 32 && line[i] != 9) cout << "�"; else if (i + sz + 33 < line.size() && string(line, i, sz) == storeDir && line[i + sz + 32] == '-') -- cgit v1.2.3