about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-08-13T17·00+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-08-13T17·00+0200
commite9b609bf9ae301eb415227e76b6ae904881c07eb (patch)
tree115c6d354842d267df3e5f33228a30698bbbfe71
parent9367046feff702af2dc5b1c5f45254b970d4da91 (diff)
nix-log2xml: Handle UTF-8 characters
C++ chars can be negative...
-rw-r--r--src/nix-log2xml/log2xml.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nix-log2xml/log2xml.cc b/src/nix-log2xml/log2xml.cc
index 6645dc500fed..e26fb0023641 100644
--- a/src/nix-log2xml/log2xml.cc
+++ b/src/nix-log2xml/log2xml.cc
@@ -137,7 +137,7 @@ void Decoder::finishLine()
         if (line[i] == '<') cout << "&lt;";
         else if (line[i] == '&') cout << "&amp;";
         else if (line[i] == '\r') ; /* ignore carriage return */
-        else if (line[i] < 32 && line[i] != 9) cout << "&#xfffd;";
+        else if (line[i] >= 0 && line[i] < 32 && line[i] != 9) cout << "&#xfffd;";
         else if (i + sz + 33 < line.size() &&
             string(line, i, sz) == storeDir &&
             line[i + sz + 32] == '-')