summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tools/moc/cbordevice.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tools/moc/cbordevice.h b/src/tools/moc/cbordevice.h
index 25b75b79eb..dbfc537dd2 100644
--- a/src/tools/moc/cbordevice.h
+++ b/src/tools/moc/cbordevice.h
@@ -82,8 +82,10 @@ private:
void putChar(char c)
{
putNewline();
- if (c < 0x20 || c >= 0x7f)
+ if (uchar(c) < 0x20)
fprintf(out, " '\\x%x',", uint8_t(c));
+ else if (uchar(c) >= 0x7f)
+ fprintf(out, " uchar('\\x%x'),", uint8_t(c));
else if (c == '\'' || c == '\\')
fprintf(out, " '\\%c',", c);
else